/* โหลดหลัง CSS เฉพาะหน้า เพื่อเชื่อมโค้ดเดิมเข้ากับ Theme Engine */
.tree-check-card,
.user-card,
.profile-editor-panel,
.settings-live-preview,
.preview-box,
.date-panel {
    background:var(--card-bg)!important;
    color:var(--card-text)!important;
    border-color:var(--card-border)!important;
}

.average-preview,.gallery-notice { color:var(--text-primary); }
.warning-notice,.settings-warning-box { color:#5d4037; }
html[data-color-mode="dark"] .warning-notice,
html[data-color-mode="dark"] .settings-warning-box { background:var(--warning-soft)!important;color:#fff1cf!important;border-color:var(--warning)!important; }

/* Accessibility override สำหรับสี Inline เดิมที่อ่านยากใน Dark Mode */
html[data-color-mode="dark"] [style*="#2e7d32"],
html[data-color-mode="dark"] [style*="#43a047"] { color:#8ee0a6!important; }
html[data-color-mode="dark"] [style*="#1976d2"],
html[data-color-mode="dark"] [style*="#1565c0"] { color:#8bc7ff!important; }
html[data-color-mode="dark"] [style*="#00897b"] { color:#76dfd2!important; }
html[data-color-mode="dark"] [style*="#8e24aa"],
html[data-color-mode="dark"] [style*="#6a1b9a"] { color:#d6a0ed!important; }
html[data-color-mode="dark"] [style*="#f57c00"] { color:#ffc06a!important; }
html[data-color-mode="dark"] [style*="#d32f2f"],
html[data-color-mode="dark"] [style*="#c62828"] { color:#ff9b94!important; }
html[data-color-mode="dark"] [style*="#757575"] { color:var(--text-secondary)!important; }

html[data-color-mode="dark"] [style*="background: #f4f4f4"],
html[data-color-mode="dark"] [style*="background:#f4f4f4"],
html[data-color-mode="dark"] [style*="background-color: #f4f4f4"],
html[data-color-mode="dark"] [style*="background: #ffffff"],
html[data-color-mode="dark"] [style*="background:#ffffff"],
html[data-color-mode="dark"] [style*="background: #fff"],
html[data-color-mode="dark"] [style*="background:#fff"] { background:var(--surface-2)!important;color:var(--text-primary)!important;border-color:var(--card-border)!important; }

html[data-color-mode="dark"] .tree-check-card { background:var(--card-bg)!important;color:var(--card-text)!important;border-color:var(--card-border)!important; }
html[data-color-mode="dark"] .settings-preview-card { background:var(--card-bg)!important; }
html[data-color-mode="dark"] .settings-live-preview { background:var(--surface-2)!important;color:var(--text-primary)!important; }
html[data-color-mode="dark"] .time-in-garden { background:var(--success-soft)!important;color:#baf1cd!important; }
html[data-color-mode="dark"] .gallery-notice { background:color-mix(in srgb,var(--accent) 13%,var(--card-bg))!important; }

/* ให้ปุ่ม/ลิงก์ที่มี Inline color สืบทอดสี Theme เมื่อไม่ได้เป็นสถานะ */
.master-header a.header-icon-btn { color:var(--header-text)!important; }
.master-footer * { border-color:var(--footer-border); }

@media print {
    [style] { text-shadow:none!important; }
}
