/* ============================================================
   Ground 화면 테마 (밝게 / 어둡게)
   · 각 화면의 <style> 안 :root 가 "밝게" 값을 정한다 (그대로). 어둡게는 html[data-theme="dark"] 로 덮어쓴다
   · 화면 코드는 색을 직접 쓰지 않고 아래 변수만 쓴다:
       --bg 바탕 · --card 카드/패널 · --surface-2 살짝 가라앉은 면(입력·칩·세그) · --surface-3 표 머리글/아주 옅은 면
       --line 얇은 구분선 · --line-strong 테두리(입력칸·표) · --hover 마우스 올린 면
       --text 본문 · --text-2 보조 · --text-3 흐린 글자 · --accent 강조(파랑) · --on-accent 강조 위 글자
       --glass 반투명 유리 패널 · --input-bg 입력칸 배경 · --shadow-c 그림자 색
   · 테마 선택은 theme.js (localStorage "theme": light | dark | system, 개인 설정으로 서버 동기화)
   ============================================================ */
:root {
  --surface-2: #f2f2f7; --surface-3: #fafafa; --line-strong: #d1d1d6; --hover: rgba(0, 0, 0, .05);
  --glass: rgba(255, 255, 255, .92); --glass-soft: rgba(255, 255, 255, .5); --nav: rgba(255, 255, 255, .6); --input-bg: #fff; --on-accent: #fff; --shadow-c: rgba(0, 0, 0, .18); --paper: #fff;
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e; --window: #1c1c1e; --card: #2c2c2e; --sidebar: rgba(30, 30, 32, .94);
  --surface-2: #3a3a3c; --surface-3: #242426; --line: rgba(255, 255, 255, .1); --line-strong: #48484a; --hover: rgba(255, 255, 255, .07);
  --text: #f5f5f7; --text-2: #b0b0b5; --text-3: #8e8e93; --accent: #0a84ff; --accent-2: #409cff; --selected: #0a84ff;
  --bubble-other: #3a3a3c; --bubble-other-text: #f5f5f7;
  --glass: rgba(36, 36, 38, .94); --glass-soft: rgba(255, 255, 255, .03); --nav: rgba(255, 255, 255, .035); --input-bg: #1c1c1e; --on-accent: #fff; --shadow: 0 10px 40px rgba(0, 0, 0, .6); --shadow-c: rgba(0, 0, 0, .6); --paper: #fff;
}
/* 어둡게에서 입력칸·선택 상자는 어두운 배경에 밝은 글자 (화면마다 따로 정하지 않은 것들) */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: var(--input-bg); color: var(--text); border-color: var(--line-strong); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: var(--text-3); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); }
/* 어둡게에서도 흰 종이로 남겨야 하는 곳 (결재 문서 종이 · 메일 본문 · 인쇄 미리보기): 그 안에서는 밝게 변수로 되돌린다 */
html[data-theme="dark"] .keep-light, html[data-theme="dark"] .paper {
  --bg: #f5f5f7; --card: #fff; --surface-2: #f2f2f7; --surface-3: #fafafa; --line: rgba(0, 0, 0, .09); --line-strong: #d1d1d6; --hover: rgba(0, 0, 0, .05);
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #a1a1a6; --glass: rgba(255, 255, 255, .92); --input-bg: #fff; --shadow-c: rgba(0, 0, 0, .18); color-scheme: light; color: var(--text);
}
html[data-theme="dark"] .keep-light input:not([type="checkbox"]):not([type="radio"]), html[data-theme="dark"] .keep-light textarea, html[data-theme="dark"] .keep-light select, html[data-theme="dark"] .paper input:not([type="checkbox"]):not([type="radio"]), html[data-theme="dark"] .paper textarea, html[data-theme="dark"] .paper select { background: #fff; color: #1d1d1f; border-color: #d1d1d6; }
/* 인쇄는 항상 밝게 (theme.js 가 인쇄 직전에 밝게로 바꾼다) */
@media print { html[data-theme="dark"] { color-scheme: light; } }
