/* 농부용 산도바로 Pro - 통합 스타일 시트 (다크모드 엔진 탑재 및 중복 최적화 버전) */
* {
    -webkit-user-select: none !important; 
    -moz-user-select: none !important;    
    -ms-user-select: none !important;     
    user-select: none !important;         
}
input, textarea {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

/* ☀️ 라이트 모드 (기본 색상) */
:root {
    --primary-dark: #1B5E20;
    --accent-soil: #C9852E;
    --accent-soil-light: #E8AA63;
    --bg-gray: #f2f4f5;
    --card-bg: #ffffff;
    --text-main: #222222;
    --text-sub: #666666;
    --border-color: #eeeeee;
    --focus-color: #CCFF00;
    
    --acid-color: #FF0000;
    --neutral-color: #00FF00;
    --alkali-color: #0000FF;

    --btn-cancel-bg: #f0f0f0;
    --btn-cancel-text: #666666;
    --btn-danger-bg: #ffebee;
    --btn-danger-text: #d32f2f;
}

/* 🌙 다크 모드 */
body.dark-mode {
    --primary-dark: #4CAF50;
    --bg-gray: #121212;
    --card-bg: #1e1e1e;
    --text-main: #f5f5f5;
    --text-sub: #aaaaaa;
    --border-color: #333333;

    --btn-cancel-bg: #333333;
    --btn-cancel-text: #aaaaaa;
    --btn-danger-bg: #4a1919;
    --btn-danger-text: #ff8a80;
}

body { 
    font-family: 'Pretendard', sans-serif; 
    margin: 0; padding: 0; 
    background-color: var(--bg-gray); 
    color: var(--text-main);          
    display: flex; flex-direction: column;
    height: 100vh; /* 폴백 */
    height: 100dvh;
    height: var(--app-h, 100dvh); /* JS가 실제 innerHeight 주입 — dvh 미지원/툴바 오차 대비(촬영 나가기 잘림 근본수정) */
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* =========================================
   상단 헤더 및 뱃지
   ========================================= */
header { 
    background-color: var(--primary-dark) !important; color: white !important; padding: 12px 16px !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important; z-index: 1000 !important; flex-shrink: 0 !important; 
    display: flex !important; flex-direction: column !important; gap: 12px !important;
    transition: background-color 0.3s;
}
.header-content-wrapper { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.header-left { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; flex: 1; overflow: hidden; padding-right: 10px; }
/* .app-title 은 610행 정의(!important)로 완전 대체되어 중복 제거함 */

.gps-badge { 
    background: rgba(0,0,0,0.25); font-size: 11px; font-weight: 800; color: #f0f0f0; 
    padding: 4px 8px; border-radius: 12px; white-space: nowrap; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.1);
}

.header-right-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-action-btn { 
    background: rgba(255,255,255,0.15) !important; border: none !important; color: white !important; 
    width: 38px !important; height: 38px !important; border-radius: 50% !important; font-size: 18px !important; 
    display: flex; justify-content: center !important; align-items: center !important; cursor: pointer !important; 
    transition: 0.2s !important; padding: 0 !important; box-shadow: none !important;
}
.icon-action-btn:active { background: rgba(255,255,255,0.3) !important; transform: scale(0.9) !important; }
.icon-action-btn.relative { position: relative !important; }

.login-compact-btn {
    background: var(--card-bg) !important; color: var(--primary-dark) !important; font-weight: 900 !important; font-size: 13px !important;
    padding: 8px 14px !important; border-radius: 20px !important; border: none !important; cursor: pointer !important; box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    transition: background-color 0.3s;
}

.header-project-row {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
    width: 100%; margin-top: 5px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,0.2);
}
.header-project-container {
    display: flex; align-items: center; gap: 8px; cursor: pointer; 
    flex: 1; min-width: 0;
}
.field-title-icon { width: 20px; height: 20px; opacity: .9; flex-shrink: 0; }
.field-title-edit { width: 15px; height: 15px; opacity: .66; flex-shrink: 0; }

.project-name-title {
    margin: 0 !important; font-size: 19px !important; font-weight: 900 !important; color: white !important;
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap !important; word-break: keep-all; line-height: 1.3;
}

.header-guide-btn {
    background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3); color: white;
    padding: 7px 14px; border-radius: 16px; font-size: 13px; font-weight: 800;
    cursor: pointer; backdrop-filter: blur(4px); white-space: nowrap;
    transition: background 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin: 0;
}
.header-guide-btn:active { background: rgba(255, 255, 255, 0.3); transform: scale(0.95); }

/* =========================================
   툴팁 및 모달 오버레이
   ========================================= */
.res-tooltip-global { 
    position: absolute; right: 15px; top: 10px; 
    background: var(--card-bg); padding: 15px; border-radius: 14px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.2); border: 2px solid var(--primary-dark);
    width: 280px; max-width: 85vw; z-index: 9000; display: none; font-size: 13.5px; color: var(--text-main); line-height: 1.5; font-weight: 600; box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}
.res-tooltip-global.show { display: block; animation: popTooltip 0.2s ease-out; }
.res-tooltip-global::before { 
    content: ''; position: absolute; top: -7px; right: 25px; width: 12px; height: 12px; 
    background: var(--card-bg); transform: rotate(45deg); border-top: 2px solid var(--primary-dark); border-left: 2px solid var(--primary-dark); 
    transition: background-color 0.3s;
}
@keyframes popTooltip { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.header-back-btn { background: rgba(255,255,255,0.2); border: none; padding: 8px 14px; border-radius: 20px !important; box-shadow: 0 2px 4px rgba(0,0,0,0.1); color: white; font-weight: 800; font-size: 14px; cursor: pointer; transition: 0.1s; display: flex; align-items: center; gap: 4px; }
.header-back-btn:active { background: rgba(255,255,255,0.3); transform: scale(0.95); }

main { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }

.view-section {
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    flex-direction: column; padding: 20px; box-sizing: border-box; overflow-y: auto; touch-action: pan-y;
}
.view-section.active { display: flex; }

.fab-new-project {
    position: fixed; bottom: 30px; right: 20px; background: var(--primary-dark); color: white;
    width: 65px; height: 65px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; box-shadow: 0 6px 16px rgba(0,0,0,0.3); border: none; cursor: pointer; z-index: 1000; transition: transform 0.1s, background-color 0.3s;
}
.fab-new-project:active { transform: scale(0.92); opacity: 0.9; }

/* =========================================
   프로젝트 리스트 및 모드 카드
   ========================================= */
.project-list-ul { list-style: none; padding: 0; margin: 0; background: var(--card-bg); border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: background-color 0.3s; }
.project-item { padding: 0; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; cursor: pointer; min-height: 80px; transition: background 0.2s, border-color 0.3s; }
.project-item:active { background: var(--bg-gray); }
.p-info { flex: 1; padding: 15px 20px; } 
.p-name { font-weight: 800; font-size: 18px; color: var(--text-main); display: block; transition: color 0.3s; }
.p-mode { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--text-sub); background: var(--bg-gray, #f1f3f5); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.p-date { font-size: 13px; color: var(--text-sub); margin-top: 6px; display: block; transition: color 0.3s; }
.p-setting-btn { background: none; border: none; font-size: 24px; padding: 20px; cursor: pointer; color: var(--text-sub); opacity: 0.8; transition: color 0.3s; }

#view-home .half-half-mode { display: flex; gap: 10px; margin-bottom: 5px !important; }
#view-home .slim-card { padding: 15px 12px !important; flex-direction: row !important; gap: 10px; justify-content: flex-start; text-align: left; border-radius: 16px; }
#view-home .slim-card .icon { font-size: 22px !important; margin: 0; }
#view-home .slim-card h3 { font-size: 14px !important; margin: 0; font-weight: 900; line-height: 1.2; color: var(--text-main); transition: color 0.3s;}
#view-home .slim-card p { font-size: 11px !important; margin: 0; color: var(--text-sub); line-height: 1.3; transition: color 0.3s;}
#view-home .half-half-mode .slim-card:nth-child(2) { position: relative !important; border: 1.5px solid var(--accent-soil) !important; box-shadow: 0 6px 15px rgba(201, 133, 46, 0.15) !important; }

/* =========================================
   로그(측정 기록) 컨테이너
   ========================================= */
.log-container { 
    background: var(--card-bg); padding: 20px; border-radius: 20px; flex: 1; 
    display: flex; flex-direction: column; box-shadow: 0 4px 12px rgba(0,0,0,0.05); overflow: hidden; transition: background-color 0.3s;
}
.log-header { 
    display: flex; justify-content: center; align-items: center; margin-bottom: 15px; font-weight: 800; font-size: 17px; color: var(--text-main); border-bottom: 2px solid var(--border-color); padding-bottom: 12px; transition: color 0.3s, border-color 0.3s;
}
#log-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; width: 100%; touch-action: pan-y; }
.log-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 5px; border-bottom: 1px solid var(--border-color); width: 100%; box-sizing: border-box; min-height: 40px; transition: border-color 0.3s; }
.log-tag { font-weight: 800; padding: 8px 16px; border-radius: 12px; color: white; font-size: 14px; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* =========================================
   카메라 UI 및 직접 기록 모드
   ========================================= */
.photo-mode-view { padding: 0 !important; background: black; }
/* min-height:0 — 촬영 후 액션영역이 (다시찍기+저장+나가기)로 커져도 카메라가 줄어들어
   '나가기' 버튼이 화면 밖(하단 툴바 뒤)으로 밀리지 않게 함. flex 자식 기본 min-height:auto 때문에 필요. */
.camera-wrapper { flex: 1; min-height: 0; position: relative; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-container { width: 100%; height: 100%; position: absolute; top:0; left:0; z-index: 1; }
.video-container video { width: 100%; height: 100%; object-fit: cover; }
.camera-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
/* 스캔 브라켓: 디버그의 실제 Pro V3 ROI(14% × 40%)와 같은 크기. JS가 영상 해상도와 object-fit:cover를 반영해 덮어쓴다. */
.scan-bracket { position: absolute; left: 50%; top: 50%; width: 14%; height: 40vw; border: 3px dashed rgba(255, 255, 255, 0.75); border-radius: 12px; transform: translate(-50%, -50%); transition: border 0.3s ease, box-shadow 0.3s ease; }
/* (상단 안내라벨 제거 2026-07-21: 하단 live-hint와 문구 중복 → 하단 하나로 통일) */
.scan-bracket.detected.acid { border: 3px solid var(--acid-color); box-shadow: 0 0 50px 2000px rgba(0,0,0,0.75), 0 0 20px rgba(255,87,34,0.8) inset, 0 0 20px rgba(255,87,34,0.8); }
.scan-bracket.detected.neutral { border: 3px solid var(--neutral-color); box-shadow: 0 0 50px 2000px rgba(0,0,0,0.75), 0 0 20px rgba(255,193,7,0.8) inset, 0 0 20px rgba(255,193,7,0.8); }
.scan-bracket.detected.alkali { border: 3px solid var(--alkali-color); box-shadow: 0 0 50px 2000px rgba(0,0,0,0.75), 0 0 20px rgba(156,39,176,0.8) inset, 0 0 20px rgba(156,39,176,0.8); }
/* 실시간 상태 힌트 (카메라 하단) */
#live-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 15; background: rgba(0,0,0,0.65); color: #fff; font-size: 16px; font-weight: 700; padding: 7px 20px; border-radius: 22px; pointer-events: none; white-space: nowrap; transition: opacity 0.3s; }

#detection-bubble { position: absolute !important; top: -80px !important; left: 50% !important; transform: translateX(-50%) !important; margin: 0 !important; }
.detection-label { display: none; position: absolute; top: -70px; background: var(--card-bg); color: var(--text-main); padding: 12px 24px; border-radius: 20px; font-weight: 900; font-size: 18px; box-shadow: 0 8px 25px rgba(0,0,0,0.5); white-space: nowrap; z-index: 20; transition: all 0.3s ease; }
.detection-label.show { display: block !important; animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); } 
.detection-label.acid { color: white; background: var(--acid-color); border: 3px solid white; }
.detection-label.neutral { color: var(--text-main); background: var(--neutral-color); border: 3px solid white; }
.detection-label.alkali { color: white; background: var(--alkali-color); border: 3px solid white; }
@keyframes popUp { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.capture-btn:disabled { background: var(--bg-gray) !important; color: var(--text-sub) !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
/* 촬영하기 버튼 */
.shoot-btn { background: var(--primary-dark); color: white; }
.shoot-btn:disabled { background: #555 !important; opacity: 0.7; cursor: not-allowed; transform: none !important; }
@keyframes scanPulse { 0%,100% { border-color: rgba(255,255,255,0.5); } 50% { border-color: rgba(255,255,255,1); } }
.scan-bracket.scanning { animation: scanPulse 0.7s ease-in-out infinite; }
/* 다시 찍기 버튼 */
.retake-btn { background: rgba(255,255,255,0.15); color: white; }

.action-area { display: flex; flex-direction: column; gap: 14px; width: 100%; align-items: center; padding: 15px 20px 30px 20px; flex-shrink: 0; z-index: 100; box-sizing: border-box; }
.photo-actions { background: rgba(10,10,10,0.95); padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.manual-actions { background: transparent; padding-bottom: 30px; margin-top: auto !important; }
.action-btn { background: var(--primary-dark); color: white; border: none; padding: 20px; border-radius: 18px; font-size: 18px; font-weight: 900; cursor: pointer; width: 100%; box-sizing: border-box; transition: background-color 0.3s; }
.action-btn:disabled { background: #555; opacity: 0.6; }
.cancel-btn { width: 100%; padding: 18px; border-radius: 18px; font-weight: 800; font-size: 16px; border: none; cursor: pointer; transition: 0.1s; box-sizing: border-box; }
.cancel-btn:active { transform: scale(0.97); }
.dark-mode-cancel { background: rgba(255,255,255,0.2); color: white; }
.light-mode-cancel { background: var(--btn-cancel-bg); color: var(--btn-cancel-text); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.manual-mode-view { background: var(--bg-gray) !important; padding: 0 !important; flex-direction: column !important; justify-content: space-between !important; height: 100vh !important; height: 100dvh !important; transition: background-color 0.3s; }
.manual-center-wrapper { flex: 1 !important; display: flex !important; flex-direction: column !important; justify-content: center !important; padding: 0 25px !important; max-width: 500px !important; margin: 0 auto !important; width: 100% !important; box-sizing: border-box !important; transform: none !important; }
.manual-btn-grid { width: 100%; display: flex; flex-direction: column; gap: 15px; padding: 0; box-sizing: border-box; }
.ph-btn { width: 100%; height: 82px; border: none; border-radius: 24px; font-size: 34px; font-weight: 900; display: flex; align-items: center; justify-content: center; transition: 0.1s; text-shadow: 0 2px 4px rgba(0,0,0,0.2); color: white; }
.ph-btn:active { transform: scale(0.96); }
.ph-btn.acid { background-color: var(--acid-color); }
.ph-btn.neutral { background-color: var(--neutral-color); color: #1a1a1a; text-shadow: none; } /* 밝은 초록 위 흰글씨 저대비 → 어두운 글씨(판독라벨과 통일, 야외 가독) */
.ph-btn.alkali { background-color: var(--alkali-color); }

/* =========================================
   모달, 음성 제어, 싱크 관련
   ========================================= */
.modal-overlay { display: none !important; position: fixed !important; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 99999; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex !important; }
.modal-content { background: var(--card-bg); padding: 35px 25px; border-radius: 28px; width: 90%; max-width: 340px; text-align: center; box-shadow: 0 15px 40px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 20px; transition: background-color 0.3s; }
.modal-content h3 { margin: 0; font-size: 22px; font-weight: 900; color: var(--text-main); transition: color 0.3s; }
#project-input { width: 100%; height: 60px; padding: 0 15px; border: 2px solid var(--border-color); border-radius: 14px; font-size: 18px; text-align: center; font-weight: bold; box-sizing: border-box; outline: none; background: var(--bg-gray); color: var(--text-main); transition: border-color 0.3s, background-color 0.3s, color 0.3s; }
#project-input:focus { border-color: var(--primary-dark); }

.voice-control-area { text-align: center; margin-bottom: 25px; background: var(--card-bg); padding: 20px; border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: background-color 0.3s; }
#voice-status { font-size: 18px; font-weight: 800; color: var(--text-sub); margin-top: 12px; height: 24px; transition: color 0.3s; }
.voice-btn { background: var(--card-bg); border: 3px solid var(--primary-dark); color: var(--primary-dark); padding: 16px 28px; border-radius: 50px; font-size: 18px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 6px 12px rgba(0,0,0,0.08); transition: all 0.2s; width: 100%; justify-content: center; box-sizing: border-box; }
.voice-btn.listening { background: var(--btn-danger-bg); border-color: var(--btn-danger-text); color: var(--btn-danger-text); animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(211, 47, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); } }

.sync-done { color: #4CAF50; font-weight: 900; font-size: 14px; }
.sync-wait { color: #999; animation: fade-blink 2s infinite; font-size: 14px; }
@keyframes fade-blink { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* =========================================
   편집 액션 바 및 토글 스위치
   ========================================= */
.project-header-container { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: center !important; margin-top: 5px !important; margin-bottom: 20px !important; width: 100% !important; gap: 10px !important; }
.p-header-text-block { display: flex !important; flex-direction: column !important; justify-content: center !important; gap: 4px !important; flex: 1 !important; min-width: 0 !important; }
#view-project .project-header-container h2 { margin: 0 !important; font-size: 18px !important; font-weight: 900 !important; color: var(--text-main); line-height: 1.2; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.5px; transition: color 0.3s; }
#view-project .project-header-container p { margin: 0 !important; font-size: 13px !important; color: var(--text-sub); font-weight: 600; line-height: 1.3; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.3px; transition: color 0.3s; }

.edit-mode-btn { background: var(--bg-gray) !important; border: 1px solid var(--border-color) !important; border-radius: 12px !important; font-weight: 800 !important; color: var(--text-main) !important; font-size: 13.5px !important; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; height: 38px !important; min-width: 80px !important; padding: 0 10px !important; flex-shrink: 0; margin: 0 !important; }
.edit-mode-btn.active { background: var(--primary-dark) !important; color: white !important; border-color: var(--primary-dark) !important; }
.checkbox-wrapper { display: flex; align-items: center; justify-content: center; width: 50px; }
.custom-checkbox { width: 24px; height: 24px; border: 2px solid var(--border-color); border-radius: 6px; display: inline-block; position: relative; transition: 0.2s; pointer-events: none; background: var(--card-bg); }
.custom-checkbox.checked { background: var(--primary-dark); border-color: var(--primary-dark); }
.custom-checkbox.checked::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 15px; height: 15px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.edit-action-bar { position: fixed; bottom: -120px; left: 0; width: 100%; display: flex; gap: 10px; padding: 15px 20px 30px; background: var(--card-bg); box-shadow: 0 -10px 25px rgba(0,0,0,0.1); transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s; z-index: 3000; border-radius: 24px 24px 0 0; box-sizing: border-box; }
.edit-action-bar.show { bottom: 0; }
.edit-action-btn { flex: 1; padding: 16px; border-radius: 16px; font-size: 15px; font-weight: 900; border: none; cursor: pointer; transition: 0.1s; }
.edit-action-btn:active { transform: scale(0.95); }
.edit-action-btn.delete { background: var(--btn-danger-bg); color: var(--btn-danger-text); border: 1px solid var(--btn-danger-bg); }
.edit-action-btn.merge { background: var(--primary-dark); color: white; box-shadow: 0 4px 10px rgba(27, 94, 32, 0.3); }
.edit-action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; border: none; }

/* 토글 스위치 */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .3s; }
.toggle-switch .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .slider { background-color: var(--neutral-color); }
.toggle-switch input:focus + .slider { box-shadow: 0 0 1px var(--neutral-color); }
.toggle-switch input:checked + .slider:before { transform: translateX(20px); }
.toggle-switch .slider.round { border-radius: 24px; }
.toggle-switch .slider.round:before { border-radius: 50%; }

/* =========================================
   알림함 (Noti) 및 바텀 시트
   ========================================= */
.noti-badge { position: absolute; top: -2px; right: -4px; background: #ff4d4d; color: white; font-size: 0.7rem; font-weight: 800; padding: 2px 5px; border-radius: 12px; min-width: 14px; text-align: center; box-shadow: 0 2px 5px rgba(255,77,77,0.4); line-height: 1; }
.noti-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-gray); z-index: 99999; flex-direction: column; animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; transition: background-color 0.3s; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.noti-center-container { display: flex; flex-direction: column; height: 100%; }
.noti-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 15px 15px; border-bottom: 1px solid var(--border-color); margin-top: 10px; transition: border-color 0.3s; }
.noti-header h2 { margin: 0; font-size: 1.25rem; color: var(--text-main); font-weight: 800; transition: color 0.3s; }
.btn-back, .btn-kebab { background: none; border: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; padding: 5px; transition: color 0.3s; }
.btn-kebab { font-weight: bold; }
.noti-tabs { padding: 0 20px; border-bottom: 1px solid var(--border-color); display: flex; gap: 20px; transition: border-color 0.3s; }
.noti-tabs span { padding: 15px 0; font-weight: 800; color: var(--text-sub); cursor: pointer; position: relative; font-size: 0.95rem; transition: color 0.3s; }
.noti-tabs span.active { color: var(--text-main); }
.noti-tabs span.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 3px; background: var(--primary-dark); border-radius: 2px; }
.noti-list-area { flex: 1; overflow-y: auto; padding: 0 20px; background: var(--bg-gray); transition: background-color 0.3s; touch-action: pan-y; }

.noti-empty { text-align: center; padding-top: 80px; color: var(--text-sub); font-weight: 600; font-size: 1rem; transition: color 0.3s; }
.noti-item { display: flex; gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--border-color); position: relative; transition: border-color 0.3s; }
.noti-icon { font-size: 1.4rem; flex-shrink: 0; }
.noti-content-box { flex: 1; }
.noti-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.noti-title { font-size: 0.95rem; font-weight: 800; color: var(--text-main); line-height: 1.3; padding-right: 15px; transition: color 0.3s; }
.noti-date { font-size: 0.75rem; color: var(--text-sub); font-weight: 600; white-space: nowrap; margin-right: 25px; transition: color 0.3s; } 
.noti-body { font-size: 0.85rem; color: var(--text-sub); line-height: 1.5; word-break: keep-all; transition: color 0.3s; }
.noti-delete-btn { background: none; border: none; color: var(--text-sub); font-size: 1.2rem; cursor: pointer; position: absolute; right: 0; top: 18px; padding: 5px; transition: 0.2s; }
.noti-delete-btn:active { color: #d32f2f; transform: scale(0.9); }

.bottom-sheet-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100000; align-items: flex-end; backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.3s; }
.bottom-sheet-overlay.show { display: flex; opacity: 1; }
.bottom-sheet-content { width: 100%; background: var(--card-bg); border-radius: 24px 24px 0 0; padding: 20px 20px 35px; box-sizing: border-box; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s; touch-action: pan-y; }
.bottom-sheet-overlay.show .bottom-sheet-content { transform: translateY(0); }
.bottom-sheet-handle { width: 40px; height: 5px; background: var(--border-color); border-radius: 3px; margin: 0 auto 25px; }

.sheet-btn { width: 100%; text-align: left; padding: 18px 10px; background: none; border: none; font-size: 1.05rem; font-weight: 700; color: var(--text-main); border-bottom: 1px solid var(--border-color); cursor: pointer; transition: color 0.3s, border-color 0.3s; }
.sheet-btn.text-danger { color: var(--btn-danger-text); }
.sheet-btn.cancel-btn { text-align: center; border-bottom: none; color: var(--text-sub); margin-top: 10px; font-weight: 600; }
.kakao-btn { background-color: #FEE500; color: #3b1e1e; border-radius: 12px; border: none; padding: 15px 20px; font-size: 16px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; width: 100%; box-sizing: border-box; }

body.lang-en, .lang-en * { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; }
.guest-banner { background: #FFF3E0; border: 1.5px solid #FFCC80; border-radius: 16px; margin: 15px 20px 5px; padding: 15px 18px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 12px rgba(230, 81, 0, 0.1); cursor: pointer; position: relative; transition: transform 0.1s; flex-shrink: 0; }
/* 다크모드: 크림 배너에 밝은 글자가 얹혀 안 보이던 문제 수정 */
body.dark-mode .guest-banner { background: #3a2c14; border-color: #6b501f; }
body.dark-mode .guest-banner-title-text, body.dark-mode .guest-banner-desc-text { color: #f1e6d4; }

/* 하단 카피라이트 글씨 사이즈 조정 */
body.lang-en #copyright { font-size: 11px !important; opacity: 0.7; }

/* =========================================
   대시보드 슬림 차트 (pH 변화 추이)
   ========================================= */
.dashboard-chart-wrapper { background: var(--card-bg); border-radius: 16px; padding: 15px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: background-color 0.3s; }

/* 🚀 통일 및 병합된 헤더 영역 */
.dashboard-chart-header { 
    display: flex !important; 
    align-items: center !important; 
    margin-bottom: 15px !important; 
    padding-left: 0 !important;
    padding-right: 35px !important; /* 오른쪽 여백 35px = 꺾쇠 너비 + 아랫줄 여백 계산 */
    gap: 10px !important; 
}

/* 🚀 통일 및 병합된 타이틀 및 라벨 (영어 버전 포함 100px로 통일) */
/* 1. 상단 타이틀 ('pH 변화 추이') - 버튼과 순서를 바꾸기 위해 order: 1 유지 */
.dashboard-chart-title {
    width: 100px !important; 
    min-width: 100px !important;
    flex-shrink: 0 !important;
    font-size: 15px !important; 
    font-weight: 900 !important; 
    color: var(--text-main) !important; 
    margin: 0 !important; 
    order: 1 !important; /* 👈 타이틀만 오른쪽으로 보냄 */
    display: flex !important; 
    align-items: center !important; 
    gap: 6px !important; 
    transition: color 0.3s; 
    letter-spacing: -0.5px !important;
}

/* 2. 바 옆의 글씨 ('4회차...') - order를 삭제하여 원래대로 왼쪽에 배치 */
.slim-bar-label {
    width: 100px !important; 
    min-width: 100px !important;
    flex-shrink: 0 !important;
    font-size: 12px !important; 
    font-weight: 800 !important; 
    color: var(--text-main);
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    transition: color 0.3s; 
    letter-spacing: -0.5px !important;
}

.slim-bar-row { display: flex; align-items: center; margin-bottom: 8px; gap: 10px; }
.slim-bar-track { flex: 1; height: 18px !important; background: var(--bg-gray); border-radius: 6px; display: flex; overflow: hidden; transition: background-color 0.3s; }
.slim-bar-segment { height: 100%; transition: width 0.5s ease; display: flex; align-items: center; justify-content: center; font-size: 11px; color: white; font-weight: 900; overflow: hidden; white-space: nowrap; }
.slim-bar-segment.acid { background: var(--acid-color); }
.slim-bar-segment.neutral { background: var(--neutral-color); }
.slim-bar-segment.alkali { background: var(--alkali-color); }

.slim-bar-row.empty .slim-bar-label { color: var(--text-sub); }
.slim-bar-row.empty .slim-bar-track { background: transparent; border: 1.5px dashed var(--border-color); }

#dashboard-chart-body { max-height: 125px !important; overflow-y: auto !important; padding-right: 5px !important; touch-action: pan-y; }
#dashboard-chart-body::-webkit-scrollbar { width: 5px; }
#dashboard-chart-body::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

#view-home { padding-bottom: 0 !important; overflow: hidden !important; }
.top-content-area { flex: 1; overflow-y: auto; padding-bottom: 120px; touch-action: pan-y; }

.bottom-sheet-style { position: absolute; bottom: 0; left: 0; width: 100%; height: 48%; background: var(--card-bg); border-radius: 28px 28px 0 0; box-shadow: 0 -8px 25px rgba(0,0,0,0.08); display: flex; flex-direction: column; padding: 5px 20px 20px; box-sizing: border-box; transition: height 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s; z-index: 100; touch-action: pan-y; }
.bottom-sheet-style.expanded { height: 88%; z-index: 300 !important; }
.bottom-sheet-style .sheet-handle { width: 45px; height: 5px; background: var(--border-color); border-radius: 3px; }

.slim-bar-row-clickable {
    position: relative !important; padding: 8px 12px !important; margin: 4px -5px !important; 
    border-radius: 12px !important; background: var(--card-bg) !important; border: 1px solid var(--border-color) !important; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s, border-color 0.3s !important;
    cursor: pointer !important; display: flex !important; align-items: center !important; -webkit-tap-highlight-color: transparent !important;
}
.slim-bar-row-clickable:active { background: var(--bg-gray) !important; transform: scale(0.98) !important; }

#manual-recommend-badge {
    position: absolute !important; top: 4px !important; right: 4px !important;
    background: linear-gradient(135deg, var(--accent-soil-light), var(--accent-soil)) !important; color: white !important;
    font-size: 9px !important; font-weight: 900 !important; padding: 3px 5px !important;
    border-radius: 6px !important; box-shadow: 0 3px 8px rgba(201, 133, 46, 0.4) !important;
    z-index: 100 !important; pointer-events: none !important;
    animation: floatBadge 2.5s infinite ease-in-out !important;
}

.uid-display-box {
    background: var(--bg-gray) !important; border: 1.5px dashed var(--border-color) !important; border-radius: 12px !important;
    padding: 12px 16px !important; margin-bottom: 15px !important; display: flex !important; 
    justify-content: space-between !important; align-items: center !important;
    cursor: pointer !important; transition: all 0.2s !important; 
}
.uid-display-box:active { 
    transform: scale(0.96) !important; border-color: var(--primary-dark) !important;
}
.uid-display-box b { 
    font-size: 14px !important; color: var(--primary-dark) !important; font-family: monospace !important; word-break: break-all !important;
}

/* 📱 PWA 설치 대형 바텀시트 스타일 */
#install-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--card-bg);
    padding: 30px 24px 40px 24px; /* 아래쪽 여백을 충분히 주어 안정감 확보 */
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    z-index: 10000;
    box-sizing: border-box;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.install-content {
    text-align: center;
    margin-bottom: 25px;
}

.install-app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.install-content h3 {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.install-content p {
    font-size: 14.5px;
    color: var(--text-sub);
    line-height: 1.5;
    margin: 0;
    word-break: keep-all;
}

/* 🧤 농부님들을 위한 왕 버튼 */
#btn-install-app {
    width: 100%;
    height: 64px; /* 시원시원한 높이 */
    background: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

#btn-install-app:active {
    transform: scale(0.97);
}

#btn-close-banner {
    width: 100%;
    height: 48px;
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* 📱 안드로이드 뒤로가기 방어 토스트 디자인 */
#exit-toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(30, 30, 30, 0.9) !important;
    color: #fff !important;
    text-align: center;
    border-radius: 20px;
    padding: 12px 20px;
    position: fixed;
    z-index: 9999999;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    pointer-events: none;
}
#exit-toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 100px;
}

.slim-bar-row-clickable.active-press {
    transform: scale(0.96);
    opacity: 0.7;
}

/* =========================================
   index.html inline style 이전 (리팩토링)
   ========================================= */
@keyframes tooltipPulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* 헤더 영역 */
#header-title-wrap { display:flex; flex-direction:column; align-items:flex-start; }
.app-title { margin: 0 !important; line-height: 1.2 !important; font-size: 17px !important; font-weight: 800; opacity: 0.9; color: rgba(255,255,255,0.9); }
#header-back-wrap { display:none; align-items:center; }
#noti-badge { display:none; }
#user-profile-btn { display:none; }
.header-guide-wrap { position:relative; }
.guide-btn-label { font-size:12px; font-weight:800; }
#onboarding-guide-tooltip { display:none; position:absolute; top: calc(100% + 14px); right: 0; background:#ffffff; color:var(--primary-dark); padding:12px 16px; border-radius:14px; font-size:13.5px; font-weight:800; z-index:1000; box-shadow:0 6px 20px rgba(0,0,0,0.15); border:1px solid rgba(0,0,0,0.05); animation: tooltipPulse 1.5s infinite; word-break:keep-all; width:max-content; max-width:240px; opacity:0; transition:opacity 0.3s; pointer-events:none; }

#header-row-home-info { display:none; }

/* 게스트 배너 */
#guest-warning-banner { display:none; margin: 0 0 25px 0; }
.guest-banner-title-text { font-weight:900; display:block; margin-bottom:2px; font-size:15px; }
.guest-banner-desc-text { font-size:13px; display:block; font-weight:500; }
.guest-banner-link-text { color:var(--primary-dark); text-decoration:underline; }

/* view-home 영역 */
.top-content-area { position:relative; }
#dashboard-chart-container { display:none; }
.log-header-toggle { cursor:pointer; justify-content:space-between; padding:0 10px 12px; }
.log-sheet-title-text { font-size:17px; }
#log-sheet-toggle-icon { font-size:13px; color:var(--text-sub); font-weight:700; background:var(--bg-gray); padding:4px 10px; border-radius:12px; }

/* view-manual 영역 */
.welcome-box-flat { padding-top:0 !important; margin-bottom: 25px !important; background: transparent; padding: 0; }
.manual-title-row { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px; }
.manual-title-text { margin:0 !important; font-size:28px; font-weight:900; }
.manual-desc-text { margin: 0; font-size:15px; color: var(--text-sub); line-height: 1.5; letter-spacing: -0.3px; }
.voice-btn.compact { padding: 16px; font-size: 18px; border-radius: 16px; }
#voice-status { margin-top: 15px; font-size: 17px; }
.manual-btn-grid.gap-15 { gap: 15px; }
.ph-btn.tall { height: 85px; font-size: 22px; border-radius: 18px; }
.ph-btn.tall.acid { box-shadow: 0 4px 10px rgba(255,0,0,0.2); }
.ph-btn.tall.neutral { box-shadow: 0 4px 10px rgba(0,255,0,0.2); }
.ph-btn.tall.alkali { box-shadow: 0 4px 10px rgba(0,0,255,0.2); }
.ph-btn.compact { height:70px; font-size:20px; border-radius:16px; }

/* 직접기록: 버튼색(빨/초/파=앱 표준)은 유지하고, 실제 시약 변색(주황/노랑/보라)을 오른쪽 흰 칩으로 표기해 혼동 방지 */
.manual-btn-grid .ph-btn { position: relative; justify-content: flex-end; padding-right: 24px; }
.ph-real-chip {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; gap: 9px;
    background: rgba(255,255,255,0.96); color: #333;
    font-size: 16px; font-weight: 800; line-height: 1;
    padding: 8px 15px; border-radius: 999px;
    text-shadow: none; box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.ph-real-dot { width: 30px; height: 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }

/* 모달 공용 버튼/행 유틸리티 */
.modal-btn-row { display:flex; gap:12px; }
.modal-btn-row.mt-15 { margin-top: 15px; }
.modal-btn-row.mt-5 { margin-top: 5px; }
.modal-btn { flex:1; padding:18px; border:none; border-radius:14px; font-size:16px; }
.modal-btn-cancel { background:var(--btn-cancel-bg); color:var(--btn-cancel-text); font-weight:700; }
.modal-btn-confirm { background:var(--primary-dark); color:white; font-weight:900; }
.modal-btn-danger { background:var(--btn-danger-bg); color:var(--btn-danger-text); font-weight:800; }
.modal-desc-text { font-size:16px; color:var(--text-sub); line-height:1.6; word-break:keep-all; font-weight:500; }
.modal-desc-text-sm { font-size:15px; color:var(--text-sub); line-height:1.6; word-break:keep-all; font-weight:500; margin:10px 0; }

/* z-index 100005로 올려야 하는 모달 4종 (farm-merge / permission-guide / push-toggle / merge-guide) */
#farm-merge-modal, #permission-guide-modal, #push-toggle-modal, #merge-guide-modal { z-index: 100005; }

/* farm-merge-modal */
#farm-merge-modal h3 { margin-bottom: 5px; }
#farm-merge-desc { font-size:14.5px; color:var(--text-sub); line-height:1.6; word-break:keep-all; margin:10px 0 15px; white-space: pre-line; }
.chart-example-box { width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 15px; border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.05); background: var(--bg-gray); }
.chart-example-label { background: rgba(0,0,0,0.05); color: var(--text-base); padding: 10px 12px; border-bottom: 1px solid var(--border-color); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; letter-spacing: -0.3px; }
#farm-merge-img { width: 100%; display: block; object-fit: cover; }
.farm-merge-btn { flex:1; padding:14px 10px; border:none; border-radius:14px; cursor: pointer; }
.farm-merge-btn-cancel { background:var(--btn-cancel-bg); color:var(--btn-cancel-text); }
.farm-merge-btn-confirm { background:var(--primary-dark); color:white; box-shadow: 0 4px 10px rgba(27, 94, 32, 0.3); }
.modal-btn-line1 { font-weight:700; font-size:13px; display:block; opacity:0.8; }
.modal-btn-line2 { font-weight:900; font-size:15px; display:block; }
.modal-btn-line1-strong { font-weight:700; font-size:13px; display:block; opacity:0.9; }

/* project-modal */
#project-memo-input { width: 100%; height: 80px; padding: 12px 15px; border: 2px solid var(--border-color); border-radius: 14px; font-size: 14px; box-sizing: border-box; outline: none; background: var(--bg-gray); color: var(--text-main); font-family: 'Pretendard', sans-serif; resize: none; margin-top: -10px; }
#btn-delete-project { display:none; background:var(--btn-danger-bg); color:var(--btn-danger-text); border:none; padding:16px; border-radius:14px; width:100%; font-weight:800; font-size:15px; margin-top:10px; }

/* log-modal */
.log-edit-btn-list { display:flex; flex-direction:column; gap:12px; margin-bottom:20px; }

/* notification-modal / permission-guide-modal / push-toggle-modal */
.noti-modal-refuse-btn { flex:1; padding:18px; border:none; border-radius:14px; background:var(--btn-cancel-bg); color:var(--btn-cancel-text); font-weight:800; font-size:15px; }
.noti-modal-accept-btn { flex:1; padding:18px; border:none; border-radius:14px; background:var(--primary-dark); color:white; font-weight:900; font-size:15px; }
.perm-modal-confirm-btn { flex:1; padding:16px; border:none; border-radius:14px; background:var(--primary-dark); color:white; font-weight:900; font-size:15px; }
.push-toggle-cancel-btn { flex:1; padding:16px; border:none; border-radius:14px; background:var(--btn-cancel-bg); color:var(--btn-cancel-text); font-weight:800; font-size:15px; }
#btn-push-toggle-confirm { flex:1; padding:16px; border:none; border-radius:14px; background:var(--primary-dark); color:white; font-weight:900; font-size:15px; }

/* noti-center / noti-bottom-sheet (헤더는 외부 css, 본문은 인라인이라 ID로 이전) */
#noti-list-area { flex:1; overflow-y:auto; display:flex; flex-direction:column; touch-action: pan-y; }
.noti-empty-fill { display:flex; flex-direction:column; justify-content:center; align-items:center; height:100%; min-height: 300px; text-align:center; color:#999; flex:1; }
#noti-bottom-sheet .bottom-sheet-content { padding: 10px 25px 25px; border-radius: 24px 24px 0 0; }
#noti-bottom-sheet .bottom-sheet-handle { margin-bottom: 25px; }
.noti-sheet-btn-list { display: flex; flex-direction: column; width: 100%; }
.noti-sheet-btn { width: 100%; padding: 18px 5px; border: none; border-bottom: 1px solid var(--border-color); background: transparent; cursor: pointer; color: var(--text-main); font-size: 16px; font-weight: 700; text-align: left; }
.noti-sheet-btn-danger { color: var(--btn-danger-text); }
.noti-sheet-btn-close { width: 100%; padding: 22px 5px 5px; border: none; background: transparent; cursor: pointer; color: var(--text-sub); font-size: 16px; font-weight: 700; }

/* merge-guide-modal */
#merge-modal-desc { font-size:15px; color:var(--text-sub); line-height:1.6; word-break:keep-all; font-weight:500; margin:10px 0; }
#btn-merge-skip { flex:1; padding:16px; border:none; border-radius:14px; background:var(--btn-cancel-bg); color:var(--btn-cancel-text); font-weight:800; font-size:15px; }
#btn-merge-confirm { flex:1; padding:16px; border:none; border-radius:14px; background:var(--primary-dark); color:white; font-weight:900; font-size:15px; }

/* login-sheet / user-info-sheet 공용 (두 시트가 동일 패턴 반복) */
.sheet-content-relative { transform: translateY(0); position: relative; max-height:calc(100dvh - 24px); overflow-y:auto; }
.sheet-content-centered { text-align: center; }
.sheet-handle-mb20 { margin-bottom: 20px; }
.sheet-title-row { border-bottom:none; padding-top:0; padding-bottom:15px; margin-bottom:5px; }
.sheet-title-row h3 { margin-top:10px; margin-bottom: 0; color: var(--primary-dark); }
#login-title { margin:0 0 8px; color:var(--primary-dark); font-size:23px; font-weight:900; letter-spacing:-.5px; }
#login-desc-html, .login-desc-text { color:var(--text-sub); font-size:0.86rem; margin:0 0 20px; line-height:1.55; }
.social-btn-list { display:flex; flex-direction:column; gap:10px; }
.social-btn { min-height:52px; box-shadow:0 5px 13px rgba(35,62,44,.07); transition:transform .12s ease, box-shadow .12s ease; }
.social-btn:active { transform:scale(.985); box-shadow:0 2px 7px rgba(35,62,44,.08); }
.social-btn:focus-visible { outline:3px solid rgba(36,88,58,.2); outline-offset:2px; }
.social-btn-icon { width:20px; margin-right:8px; }
.kakao-btn-social { background:#FEE500; color:#3b1e1e; border:none; display:flex; align-items:center; justify-content:center; padding:15px; border-radius:12px; font-weight:bold; cursor:pointer; width:100%; font-size:16px; }
.google-btn-social { background:var(--card-bg); color:var(--text-main); border:1px solid var(--border-color); display:flex; align-items:center; justify-content:center; padding:15px; border-radius:12px; font-weight:bold; cursor:pointer; }
.email-btn-social { background:var(--btn-cancel-bg); color:var(--text-main); border:none; display:flex; align-items:center; justify-content:center; padding:15px; border-radius:12px; font-weight:bold; cursor:pointer; }
#legal-text-container { text-align:center; font-size:0.75rem; color:var(--text-sub); margin-top:20px; }
#ccpa-container { display: none; margin-top: 20px; text-align: left; padding: 0 5px; }
.ccpa-label-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
#ccpa-agree { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary-dark); }
.ccpa-agree-text { font-size: 0.8rem; color: var(--text-sub); line-height: 1.4; }
.theme-setting-block { margin-top: 18px; padding-top:14px; border-top:1px solid var(--border-color); text-align: left; }
.theme-setting-label { font-size: 12px; color: var(--text-sub); font-weight: 800; margin-left: 5px; display: block; margin-bottom: 8px; }
.lang-theme-row { display: flex; gap: 10px; margin-top: 15px; align-items: stretch; }
.lang-switch-btn { flex: 1; background:rgba(76, 175, 80, 0.1); color:var(--primary-dark); border:1px solid rgba(76, 175, 80, 0.2); display:flex; align-items:center; justify-content:center; padding:10px; border-radius:14px; font-weight:bold; cursor:pointer; }
.theme-toggle-group { flex: 1.2; display: flex; background: var(--bg-gray); padding: 4px; border-radius: 14px; gap: 4px; }
.theme-toggle-btn { flex: 1; border: none; padding: 10px 0; border-radius: 10px; font-size: 12px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.theme-toggle-btn.light-active { background: var(--card-bg); color: var(--text-main); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.theme-toggle-btn.dark-inactive { background: transparent; color: var(--text-sub); }
.uid-display-box.mt-20 { margin-top: 20px; }
.uid-box-left { text-align: left; }
.uid-box-label { font-size:11px; color:var(--text-sub); display:block; margin-bottom:2px; }
.app-version-display { text-align:center; font-size:14px; color:var(--text-sub); margin-top:20px; font-weight:700; letter-spacing:0px; }
.app-version-display.mt-25 { margin-top: 25px; }
.guest-id-details { margin-top:14px; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-gray); overflow:hidden; }
.guest-id-details summary { min-height:54px; box-sizing:border-box; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 13px; cursor:pointer; list-style:none; }
.guest-id-details summary::-webkit-details-marker { display:none; }
.guest-id-details summary b { display:block; color:var(--text-main); font-size:12px; }
.guest-id-details summary small { display:block; margin-top:3px; color:var(--text-sub); font-size:9.5px; }
.guest-id-chevron { color:var(--text-sub); transition:transform .2s; }
.guest-id-details[open] .guest-id-chevron { transform:rotate(180deg); }
.guest-id-details .uid-display-box { margin:0 9px 9px; border-radius:11px; background:var(--card-bg); }

/* email-modal */
#email-modal { display:none; justify-content:center; align-items:center; z-index:100001; }
.email-modal-box { background:var(--card-bg); width:85%; max-width:320px; padding:25px; border-radius:16px; box-sizing:border-box; position:relative; }
#email-modal-title { margin-top:0; color:var(--primary-dark); }
#email-modal-desc { font-size:0.85rem; color:var(--text-sub); margin-bottom:15px; word-break:keep-all; }
.email-input-field { width:100%; padding:12px; margin-bottom:10px; border:1px solid var(--border-color); border-radius:8px; box-sizing:border-box; font-family:'Pretendard'; background: var(--bg-gray); color: var(--text-main); }
.email-input-field.hidden { display:none; }
.email-forgot-row { display:flex; justify-content:center; margin-bottom:15px; font-size:13px; }
.email-forgot-link { color:var(--text-sub); text-decoration:underline; }
.email-btn-row { display:flex; gap:10px; margin-bottom:20px; }
.email-btn { flex:1; padding:12px; border:none; border-radius:8px; font-weight:bold; cursor:pointer; }
.email-btn-cancel { background:var(--btn-cancel-bg); color:var(--btn-cancel-text); }
.email-btn-submit { background:var(--primary-dark); color:#fff; }
.email-toggle-row { text-align:center; font-size:13px; }
.email-toggle-link { color:var(--primary-dark); text-decoration:underline; font-weight:bold; }

/* user-info-sheet 전용 */
.user-account-sheet { text-align: left; }
.user-account-sheet .sheet-title-row { text-align: center; }
.user-profile-card { display:flex; align-items:center; gap:12px; margin:0 0 12px; padding:15px; border:1px solid var(--border-color); border-radius:17px; background:var(--bg-gray); }
.user-profile-avatar { width:42px; height:42px; padding:10px; box-sizing:border-box; flex:0 0 auto; border-radius:14px; color:var(--primary-dark); background:rgba(76,175,80,.12); }
.user-profile-copy { min-width:0; flex:1; }
.user-profile-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-main); font-size:16px; }
#sheet-user-email { display:block; overflow:hidden; margin-top:4px; color:var(--text-sub); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.login-provider-badge { display:none; flex:0 0 auto; padding:5px 8px; border-radius:999px; color:var(--primary-dark); background:rgba(76,175,80,.1); font-size:10px; font-weight:900; }
.user-partner-status { display:none; margin:0 0 15px; padding:10px 12px; border:1px solid rgba(155,107,55,.2); border-radius:13px; background:rgba(155,107,55,.08); color:#8a5b27; font-size:12px; font-weight:900; text-align:left; }
.user-partner-status.approved { border-color:rgba(36,88,58,.18); background:#e9f3e9; color:#24583a; }
.user-partner-status.pending { border-color:rgba(192,126,37,.2); background:#fff4df; color:#9b661f; }
.user-partner-status.rejected { border-color:rgba(179,64,55,.18); background:#fff0ed; color:#a83c34; }
.user-settings-block { margin-top:15px; }
.user-section-label { display:block; margin:0 0 8px 2px; color:var(--text-sub); font-size:11px; font-weight:850; }
.user-sheet-toprow { display:flex; gap:10px; margin-bottom:14px; align-items:stretch; }
.user-id-details { margin:0 0 14px; border:1px solid var(--border-color); border-radius:15px; background:var(--card-bg); overflow:hidden; }
.user-id-details summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:58px; padding:10px 14px; box-sizing:border-box; cursor:pointer; list-style:none; }
.user-id-details summary::-webkit-details-marker { display:none; }
.user-id-details summary b { display:block; color:var(--text-main); font-size:13px; }
.user-id-details summary small { display:block; margin-top:3px; color:var(--text-sub); font-size:10px; }
.user-id-details-chevron { color:var(--text-sub); transition:transform .2s; }
.user-id-details[open] .user-id-details-chevron { transform:rotate(180deg); }
.user-id-details .uid-display-box { margin:0 10px 10px; border-radius:12px; }
.uid-copy-action { padding:5px 8px; border-radius:8px; color:var(--primary-dark); background:rgba(76,175,80,.1); font-size:11px; font-weight:900; }
.user-sheet-actions { display:flex; flex-direction:column; gap:7px; margin-bottom:8px; }
.user-sheet-btn { width:100%; padding:14px; border:none; border-radius:13px; font-weight:800; cursor:pointer; display:flex; justify-content:center; align-items:center; gap:8px; }
.user-sheet-btn-logout { background:var(--btn-cancel-bg); color:var(--text-main); }
.user-sheet-btn-delete { padding:10px; background:transparent; border:0; font-size:12px; font-weight:650; color:#b26a65; }
.user-account-sheet .app-version-display { margin-top:14px; text-align:center; }

/* 밭 등록 — 측정 방식(노지/하우스) 선택 */
.locmode-options { display:flex; gap:10px; margin-top:8px; }
.locmode-opt { flex:1; display:flex; align-items:center; gap:8px; padding:12px; border:2px solid var(--border-color); border-radius:12px; cursor:pointer; transition:border-color .15s, background .15s; }
.locmode-opt:has(input:checked) { border-color:var(--primary-dark); background:rgba(76,175,80,0.09); }
.locmode-opt input { accent-color:var(--primary-dark); width:18px; height:18px; flex-shrink:0; }
.locmode-copy { display:flex; flex-direction:column; line-height:1.3; }
.locmode-copy b { font-size:14px; color:var(--text-main); }
.locmode-copy small { font-size:11px; color:var(--text-sub); margin-top:2px; }
