/* =====================================================================
   다크 모드 (html[data-theme=dark]) — app.css·settings.css 위에 덮어쓴다.
   app.css는 고치지 않으므로 라이트 모드는 원래 화면 그대로다.
   대비: 본문 #ecebfa / 보조 #b4b2cc / 강조 #b3a6ff — 카드(#1f1f3a)와 배경(#14142b) 위에서 4.5:1 이상.
   날씨 상세 창(.wx-*)은 원래 어두운 디자인이라 그대로 둔다.
   ===================================================================== */
html[data-theme=dark]{
  color-scheme:dark;
  --ink:#ecebfa;--muted:#b4b2cc;--line:#34335a;--bg:#14142b;--white:#1f1f3a;--lavender:#2b2754;
  --d-surface:#1f1f3a;--d-surface-2:#272747;--d-surface-3:#2f2e55;--d-line:#34335a;--d-ink:#ecebfa;--d-muted:#b4b2cc;--d-accent:#b3a6ff;
  --shadow:0 12px 36px rgba(0,0,0,.35);
  background:var(--bg)
}
html[data-theme=dark] body{background:var(--bg);color:var(--d-ink)}

/* ---- 공통 표면 ---- */
html[data-theme=dark] .sidebar,
html[data-theme=dark] .topbar,
html[data-theme=dark] .panel,
html[data-theme=dark] .stat-card,
html[data-theme=dark] .dfc,
html[data-theme=dark] .sm-dialog,
html[data-theme=dark] .dfc-pop,
html[data-theme=dark] .floating-card,
html[data-theme=dark] .auth-layout{background:var(--d-surface);border-color:var(--d-line);color:var(--d-ink)}
html[data-theme=dark] .sidebar{border-right-color:var(--d-line);border-bottom-color:var(--d-line)}
html[data-theme=dark] .sidebar-bottom,html[data-theme=dark] .agenda{border-top-color:var(--d-line)}
html[data-theme=dark] .muted,html[data-theme=dark] .user-meta small,html[data-theme=dark] .agenda-head p,
html[data-theme=dark] .agenda-item small,html[data-theme=dark] .footer,html[data-theme=dark] .footer span,
html[data-theme=dark] .panel-heading p,html[data-theme=dark] .stat-foot,html[data-theme=dark] .form-field small,
html[data-theme=dark] .vm-hint,html[data-theme=dark] .vm-head p,html[data-theme=dark] .vm-file,
html[data-theme=dark] .st-desc,html[data-theme=dark] .guest-links span,html[data-theme=dark] .brand small,
html[data-theme=dark] .auth-switch,html[data-theme=dark] .remember small,html[data-theme=dark] .dfc-pop-hint{color:var(--d-muted)}
html[data-theme=dark] .eyebrow,html[data-theme=dark] .text-link,html[data-theme=dark] .auth-switch a,
html[data-theme=dark] .wave,html[data-theme=dark] .vm-file u{color:var(--d-accent)}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] .user-meta strong,
html[data-theme=dark] .table-title,html[data-theme=dark] .vm-status{color:var(--d-ink)}

/* ---- 버튼 ---- */
html[data-theme=dark] .button-outline,html[data-theme=dark] .sm-delete,html[data-theme=dark] .dfc-pop-btn{background:var(--d-surface-2);border-color:var(--d-line);color:var(--d-ink)}
html[data-theme=dark] .button-outline:hover,html[data-theme=dark] .dfc-pop-btn:hover{background:var(--d-surface-3)}
html[data-theme=dark] .sm-delete{color:#ff8fa0;border-color:#7a3446}
html[data-theme=dark] .sm-delete:hover{background:#3a1f2c}
html[data-theme=dark] .button-soft,html[data-theme=dark] .agenda-today{background:#2f2a5e;color:#d3cbff}
html[data-theme=dark] .button-light{background:var(--d-surface-2);color:var(--d-accent)}
html[data-theme=dark] .dfc-pop-btn.is-primary{background:var(--purple);border-color:var(--purple);color:#fff}
html[data-theme=dark] .logout-button:hover{border-color:#7a3446;color:#ff8fa0}
html[data-theme=dark] .st-gear,html[data-theme=dark] .theme-toggle,html[data-theme=dark] .home-link{background:var(--d-surface-2);border-color:var(--d-line);color:#d6d4ee}
html[data-theme=dark] .st-gear:hover,html[data-theme=dark] .st-gear:focus-visible,
html[data-theme=dark] .theme-toggle:hover,html[data-theme=dark] .theme-toggle:focus-visible{background:#2f2a5e;color:#d3cbff;border-color:#4b4390}
html[data-theme=dark] .st-dot{box-shadow:0 0 0 2px var(--d-surface)}
html[data-theme=dark] .avatar,html[data-theme=dark] .top-avatar{background:#2f2a5e;color:#d3cbff}
html[data-theme=dark] .fab-badge{background:var(--d-surface)}

/* ---- 입력 ---- */
html[data-theme=dark] .form-control,
html[data-theme=dark] .sm-field input,html[data-theme=dark] .sm-field select,html[data-theme=dark] .sm-field textarea,
html[data-theme=dark] .sm-when input{background:var(--d-surface-2);border-color:#45446c;color:var(--d-ink)}
html[data-theme=dark] .sm-when input::placeholder,html[data-theme=dark] .form-control::placeholder,
html[data-theme=dark] .sm-field input::placeholder,html[data-theme=dark] .sm-field textarea::placeholder{color:#8e8cab}
html[data-theme=dark] .form-field label,html[data-theme=dark] .sm-field>span,html[data-theme=dark] .sm-num span{color:#d6d4ee}
html[data-theme=dark] .sm-field em{color:#ff8fa0}
html[data-theme=dark] .sm-ampm{background:var(--d-surface-3)}
html[data-theme=dark] .sm-ampm button{color:#c9c7e2}
html[data-theme=dark] .sm-ampm button[aria-pressed=true]{background:#7b61f0;color:#fff}
html[data-theme=dark] .sm-chips button,html[data-theme=dark] .st-theme-options label{background:var(--d-surface-2);border-color:#45446c;color:#d6d4ee}
html[data-theme=dark] .sm-chips button:hover,html[data-theme=dark] .st-theme-options label:hover{border-color:#8f80f5;color:#e2dcff}
html[data-theme=dark] .sm-chips button[aria-pressed=true],
html[data-theme=dark] .st-theme-options label:has(input:checked){background:#33296e;border-color:#8f80f5;color:#f0edff;box-shadow:inset 0 0 0 1px #8f80f5}
html[data-theme=dark] .remember{color:#d6d4ee}
html[data-theme=dark] select option{background:var(--d-surface-2);color:var(--d-ink)}

/* ---- 팝업 ---- */
html[data-theme=dark] .sm-overlay,html[data-theme=dark] .wx-overlay{background:#05051099}
html[data-theme=dark] .sm-close{background:var(--d-surface-3);color:#d6d4ee}
html[data-theme=dark] .sm-close:hover{background:#3a3966}
html[data-theme=dark] .sm-message{background:#3a1f2c;color:#ffb3bf}
html[data-theme=dark] .sm-confirm{background:#3a1f2c}
html[data-theme=dark] .sm-confirm strong{color:#ffb3bf}
html[data-theme=dark] .sm-summary{background:#2b2754;color:#e2dcff}
html[data-theme=dark] .sm-summary.is-empty{background:#3a2e18;color:#ffd48a}
html[data-theme=dark] .sm-ai{background:#2b2754;color:#d3cbff}
html[data-theme=dark] .sm-ai q{color:#d6d4ee}
html[data-theme=dark] .sm-ai small{color:#ffb27a}
html[data-theme=dark] .vm-head{border-bottom-color:var(--d-line)}
html[data-theme=dark] .vm-badge{background:#2f2a5e;color:#d3cbff}
html[data-theme=dark] .vm-mic{box-shadow:0 0 0 14px #2b2754,0 0 0 28px #211f40}
html[data-theme=dark] .vm-dialog[data-state=recording] .vm-mic{box-shadow:0 0 0 14px #4a1f2c,0 0 0 28px #331722}
html[data-theme=dark] .vm-live{background:var(--d-surface-2);border-color:var(--d-line)}
html[data-theme=dark] .vm-live small strong{color:var(--d-accent)}
html[data-theme=dark] .st-sync-text,html[data-theme=dark] .st-status{color:#d6d4ee}
html[data-theme=dark] .st-sync-text b{color:var(--d-accent)}
html[data-theme=dark] .st-status.is-error{color:#ffb3bf}
html[data-theme=dark] .st-theme legend{color:var(--d-ink)}
html[data-theme=dark] .dfc-pop{box-shadow:0 18px 44px #0008}
html[data-theme=dark] .dfc-pop-line{color:#d6d4ee}

/* ---- 알림·배너·메시지 ---- */
html[data-theme=dark] .sync-banner{background:#262250;border-color:#4b4390}
html[data-theme=dark] .sync-text strong{color:#e2dcff}
html[data-theme=dark] .sync-text span,html[data-theme=dark] .sync-status{color:#d6d4ee}
html[data-theme=dark] .sync-status.is-error{color:#ffb3bf}
html[data-theme=dark] .message{background:#163428;color:#9de3c0}
html[data-theme=dark] .message-error{background:#3a1f2c;color:#ffb3bf}
html[data-theme=dark] .guest-notice,html[data-theme=dark] .integration-note,html[data-theme=dark] .guest-note{background:#262250;border-color:#4b4390;color:#e2dcff}
html[data-theme=dark] .guest-notice strong,html[data-theme=dark] .integration-note strong{color:#e2dcff}
html[data-theme=dark] .guest-notice span,html[data-theme=dark] .integration-note span{color:#d6d4ee}

/* ---- 왼쪽 일정 패널 ---- */
html[data-theme=dark] .agenda-item{background:var(--d-surface-2);border-top-color:var(--d-line);border-right-color:var(--d-line);border-bottom-color:var(--d-line)}
html[data-theme=dark] .agenda-item:hover{background:var(--d-surface-3)}
html[data-theme=dark] .agenda-time{color:var(--d-accent)}
html[data-theme=dark] .agenda-empty{border-color:#45446c;color:var(--d-muted)}
html[data-theme=dark] .agenda-trash{color:#a9a7c4}
html[data-theme=dark] .agenda-trash:hover{background:#3a1f2c;color:#ff8fa0}

/* ---- 캘린더 ---- */
html[data-theme=dark] .dfc-toolbar,html[data-theme=dark] .dfc-summary,html[data-theme=dark] .dfc-dow,html[data-theme=dark] .dfc-row{border-color:var(--d-line)}
html[data-theme=dark] .dfc-summary{color:#d6d4ee}
html[data-theme=dark] .dfc-summary b,html[data-theme=dark] .dfc-today-tag,html[data-theme=dark] .dfc-more{color:var(--d-accent)}
html[data-theme=dark] .dfc-btn{background:var(--d-surface-2);border-color:var(--d-line);color:#d6d4ee}
html[data-theme=dark] .dfc-btn:hover{background:#2f2a5e;color:#e2dcff;border-color:#4b4390}
html[data-theme=dark] .dfc-dow span{color:#d6d4ee}
html[data-theme=dark] .dfc-dow .is-sat{color:#7aa2ff}
html[data-theme=dark] .dfc-dow .is-sun{color:#ff7a8f}
html[data-theme=dark] .dfc-cell{box-shadow:1px 0 0 var(--d-line)}
html[data-theme=dark] .dfc-cell.is-out{background:#191932}
html[data-theme=dark] .dfc-cell.is-today{background:#29254f}
html[data-theme=dark] .dfc-cell.is-selected{background:#2d2860;border-color:#8f80f5;box-shadow:inset 0 0 0 1px #8f80f5}
html[data-theme=dark] .dfc-daynum span{color:var(--d-ink)}
html[data-theme=dark] .dfc-cell.is-out .dfc-daynum span{color:#8e8cab}
html[data-theme=dark] .dfc-cell.is-sun .dfc-daynum span,html[data-theme=dark] .dfc-cell.is-holiday .dfc-daynum span,
html[data-theme=dark] .dfc-holiday{color:#ff7a8f}
html[data-theme=dark] .dfc-cell.is-today .dfc-daynum span{background:#7b6bf5;color:#fff}
html[data-theme=dark] .dfc-more:hover{background:#2f2a5e}
/* 일정 막대: 어두운 바탕 + 밝은 글자, 일정마다의 선 색은 유지 */
html[data-theme=dark] .dfc-chip,html[data-theme=dark] .dfc-ev{background:color-mix(in srgb,var(--ev-line) 26%,#1f1f3a);color:#f1f0fb}
html[data-theme=dark] .dfc-chip .t{color:#d6d4ee}
html[data-theme=dark] .dfc-extend::after{background:#f1f0fb}
html[data-theme=dark] .dfc-chip:hover{box-shadow:0 5px 14px #0007}
/* 우선순위 */
html[data-theme=dark] .prio-high{background:#e5485a;color:#fff}
html[data-theme=dark] .prio-normal{background:transparent;color:#ecebfa;box-shadow:inset 0 0 0 1px #8e8cab}
html[data-theme=dark] .prio-low{color:#c9c7e2;box-shadow:inset 0 0 0 1px #5d5b82}

/* ---- 상세·표·상태 ---- */
html[data-theme=dark] .detail-row{border-top-color:var(--d-line)}
html[data-theme=dark] .detail-row span{color:var(--d-muted)}
html[data-theme=dark] .soft-badge{background:var(--d-surface-3);color:#d6d4ee}
html[data-theme=dark] .status-todo{background:#2b2754;color:#d3cbff}
html[data-theme=dark] .status-progress{background:#3a2e18;color:#ffc58a}
html[data-theme=dark] .status-done{background:#163428;color:#9de3c0}
html[data-theme=dark] th{color:var(--d-muted);border-bottom-color:var(--d-line)}
html[data-theme=dark] td{color:#d6d4ee;border-bottom-color:var(--d-line)}
html[data-theme=dark] .schedule-item,html[data-theme=dark] .upcoming-item{border-top-color:var(--d-line)}
html[data-theme=dark] .empty-symbol,html[data-theme=dark] .date-tile{background:#2b2754;border-color:var(--d-line)}
html[data-theme=dark] .confirm-panel p,html[data-theme=dark] .voice-panel>p,html[data-theme=dark] .weather-panel>p{color:var(--d-muted)}
html[data-theme=dark] .voice-orb{box-shadow:0 0 0 13px #2b2754,0 0 0 25px #211f40}

/* ---- 로그인·회원가입 ---- */
html[data-theme=dark] .auth-brand{background:linear-gradient(145deg,#4a3fb0,#6a5bd6)}
html[data-theme=dark] .auth-card .muted{color:var(--d-muted)}
