/* Puntom — Koyu Mod (Zen Rose dark). TÜMÜ html.dark kapsamlı; stylesheet !important inline stilleri ezer.
   Kapsam: app sayfaları (pano/biçimlendirici/kitaplık/şablonlar/profil/plan/ayarlar). Tanıtım+yasal AÇIK kalır.
   İSTİSNA (en sonda re-assert): #doc-preview içindeki belge sayfaları KAĞIT-BEYAZ kalır (okunurluk).
   Not: [style*="…"] seçicileri koddaki BİREBİR yazımlara bağlıdır (boşluk varyantları dahil) — kapsam testi: dark-coverage.js */

/* ── 0) Native form popup'ları UYGULAMA temasını izler (Chrome-koyu siyah popup düzeltmesi) ── */
:root { color-scheme: light; }
html.dark { color-scheme: dark; }

/* ── 1) Tailwind token utility'leri ─────────────────────────────────────── */
html.dark body { background-color: #121212 !important; color: #e8e6e3 !important; }
html.dark .bg-background { background-color: #121212 !important; }
html.dark .bg-surface, html.dark .bg-surface-bright { background-color: #161616 !important; }
html.dark .bg-surface-container-lowest { background-color: #1c1c1b !important; }
html.dark .bg-surface-container-low { background-color: #1d1d1c !important; }
html.dark .bg-surface-container { background-color: #222220 !important; }
html.dark .bg-surface-container-high { background-color: #262624 !important; }
html.dark .bg-surface-container-highest, html.dark .bg-surface-variant { background-color: #2a2a28 !important; }
html.dark .text-on-background, html.dark .text-on-surface { color: #e8e6e3 !important; }
html.dark .text-on-surface-variant { color: #a6a49f !important; }
html.dark .text-outline, html.dark .text-outline-variant { color: #8a8884 !important; }
html.dark .text-primary { color: #E3B79E !important; }
html.dark .text-primary-container { color: #ECD3C5 !important; }
html.dark .border-surface-variant { border-color: #34342f !important; }
html.dark .ring-surface-variant { --tw-ring-color: #34342f !important; }
html.dark .border-outline-variant { border-color: #3d3d38 !important; }
html.dark .bg-outline-variant { background-color: #3d3d38 !important; }
html.dark .placeholder-on-surface-variant::placeholder, html.dark input::placeholder, html.dark textarea::placeholder { color: #77756f !important; }
html.dark .ambient-shadow { box-shadow: 0 4px 16px -2px rgba(0,0,0,.55), 0 2px 6px -1px rgba(0,0,0,.4) !important; }
html.dark .bg-primary\/10 { background-color: rgba(189,121,95,.14) !important; }
html.dark .border-primary\/20 { border-color: rgba(189,121,95,.3) !important; }
html.dark .hover\:bg-surface-variant\/40:hover { background-color: rgba(70,70,66,.4) !important; }
html.dark .bg-tertiary-container\/10 { background-color: rgba(123,116,102,.18) !important; }
html.dark .text-tertiary { color: #b5ad9c !important; }

/* ── 2) Sayfa-içi <style> ezmeleri (sidebar nav) ────────────────────────── */
html.dark .nav-item:hover { background-color: #232320 !important; }
html.dark .nav-item.active { color: #eae8e4 !important; background-color: #27271f !important; }
/* Koyu zeminde marka setindeki beyaz yazılı kilidi kullan; ikon renkleri korunur. */
html.dark img[src="/design/brand/lockup/puntom-lockup-icon.png"] {
  content: url("/design/brand/lockup/puntom-lockup-icon-inverse.png");
}

/* ── 3) Inline stiller — marka beige + metin/kenarlık hex'leri ──────────── */
/* marka beige buton/rozet (üç yazım varyantı) → koyu-sıcak zemin + açık metin */
html.dark [style*="background-color:rgb(229,225,218)"],
html.dark [style*="background-color: rgb(229, 225, 218)"],
html.dark [style*="background-color:rgb(229, 225, 218)"] { background-color: #454034 !important; color: #ece5d8 !important; }
html.dark [style*="border-top-color: rgb(229, 225, 218)"] { border-top-color: #454034 !important; }
/* koyu metinler → açık */
html.dark [style*="color:rgb(26,28,28)"], html.dark [style*="color: rgb(26, 28, 28)"],
html.dark [style*="color:#2b2b29"], html.dark [style*="color:#1a1c1c"] { color: #e8e6e3 !important; }
html.dark [style*="color:#5a5648"], html.dark [style*="color:#5a5a57"] { color: #b5b2ac !important; }
html.dark [style*="color:#737970"] { color: #a6a49f !important; }
html.dark [style*="color:#9a9a96"], html.dark [style*="color:#b3afa6"] { color: #8a8884 !important; }
html.dark [style*="color:#9a7b4f"] { color: #c9ab7d !important; }
/* beyaz/açık zeminler (property-nitelikli — çıplak #fff YASAK: color:#fff butonları bozar) */
html.dark [style*="background:#fff"], html.dark [style*="background: #fff"],
html.dark [style*="background-color:#ffffff"], html.dark [style*="background:#ffffff"] { background-color: #1e1e1d !important; }
html.dark [style*="background:#f9f9f8"] { background-color: #161616 !important; }
html.dark [style*="background:#fafaf8"], html.dark [style*="background:#fdfcfa"] { background-color: #1a1a19 !important; }
html.dark [style*="background:#faf6ee"] { background-color: #26221b !important; }
html.dark [style*="background:#f6efe4"], html.dark [style*="background:#f4efe8"], html.dark [style*="background:#f0e6d2"] { background-color: #2b261e !important; }
html.dark [style*="background:#F8ECE5"] { background-color: #262521 !important; }
html.dark [style*="background:#fbf3e6"] { background-color: #2b2620 !important; }
html.dark [style*="background:#eef6ef"] { background-color: #1c2a1c !important; color: #9ccc9c !important; }
html.dark [style*="background:#fbecec"], html.dark [style*="background:#fdecea"] { background-color: #2e1d1d !important; color: #e2a0a0 !important; }
/* açık çizgiler — NÖTR-GRİ SİSTEM (#DCDCDE soft / #7E7E80 strong) → koyu.
   'solid #X' / 'dashed #X' substring'i tüm kenar-yönü/kalınlık varyantlarını tek seçicide yakalar. */
html.dark [style*="solid #DCDCDE"], html.dark [style*="dashed #DCDCDE"],
html.dark [style*="border-color:#DCDCDE"], html.dark [style*="border-color: #DCDCDE"],
html.dark [style*="border-top-color: #DCDCDE"], html.dark .border-\[\#DCDCDE\] { border-color: #34342f !important; }
html.dark [style*="background:#DCDCDE"], html.dark [style*="background-color:#DCDCDE"],
html.dark [style*="background-color: #DCDCDE"] { background-color: #34342f !important; }
html.dark [style*="0 0 0 1px #DCDCDE"] { box-shadow: 0 0 0 1px #34342f !important; }
html.dark [style*="solid #7E7E80"], html.dark [style*="dashed #7E7E80"] { border-color: #3d3d38 !important; }
html.dark [style*="background:#7E7E80"] { background-color: #3d3d38 !important; }
html.dark [style*="color:#7E7E80"] { color: #a6a49f !important; }
html.dark [style*="background:#2b2b29"] { background-color: #d6d3cd !important; color: #1a1c1c !important; } /* koyu birincil buton → açık zıt */
/* dekoratif önce/sonra çubukları + paywall */
html.dark [style*="background:#d3cdc2"] { background-color: #4a4943 !important; }
html.dark [style*="background:#e8e3da"] { background-color: #3a3a35 !important; }
html.dark [style*="border:1px dashed #d8d3ca"] { border-color: #4a4943 !important; }
html.dark [style*="background:#FBF7F0"] { background-color: #2b2620 !important; }
html.dark [style*="color:#8a8a86"] { color: #a6a49f !important; }

/* ── 4) Bileşenler ──────────────────────────────────────────────────────── */
html.dark .sf-gcard { background: #1f1f1e !important; border-color: #34342f !important; }
html.dark .sf-gcard:hover { background: #242422 !important; border-color: #454034 !important; }
/* Ayar kartlarının başlıkları inline #2A2620 taşıyor. İndirme düğmesindeki sıcak
   vurgunun metne uygun açık tonu: #1f1f1e zemin üzerinde 9,06:1 kontrast. */
html.dark .sf-gcard > div:first-child > span:nth-child(2),
html.dark #sf-ai-open > div:nth-child(2) > div:first-child,
html.dark #sf-rules-open > span:nth-child(2) > span:first-child,
html.dark #sf-head > span:not(.material-symbols-outlined),
html.dark #sf-panel .sf-feat > span:nth-child(2),
html.dark #sf-panel #sf-scroll > div:first-child > div:first-child > div:first-child,
html.dark #sf-panel #sf-scroll > button#sf-back + div { color: #E3B79E !important; }
/* Modül açıklamalarındaki sabit açık-tema rengi de koyu zeminde okunur kalır. */
html.dark #sf-panel [style*="color:#5F584E"] { color: #b5b2ac !important; }
html.dark #sf-ai-open { background: #26221b !important; border-color: #454034 !important; }
html.dark #sf-panel, html.dark #sf-auth [role="dialog"], html.dark #sf-ai-panel { background: #1e1e1d !important; }
html.dark #sf-ai-body { background: #161616 !important; }
html.dark #sf-tpl-editor > div { background: #161616 !important; }
html.dark #sf-paywall > div { background: #1e1e1d !important; }
html.dark .sf-pw-plan { background: #1f1f1e !important; border-color: #34342f !important; color: #e8e6e3 !important; }
html.dark input:not([type="checkbox"]):not([type="file"]), html.dark textarea, html.dark select {
  background-color: #1d1d1c !important; color: #e8e6e3 !important; border-color: #34342f !important;
}
html.dark #drop-zone { border-color: #3d3d38 !important; }
/* alt-özellik toggle: pasif → koyu track; aktif (peer:checked) → terracotta (özgüllük off'u ezer) */
html.dark .bg-\[\#F3F4F3\] { background-color: #2a2a28 !important; }
html.dark .peer:checked ~ .peer-checked\:bg-\[\#BD795F\] { background-color: #BD795F !important; }
html.dark #sf-checkout-banner { filter: none; }

/* ── 5) Belge önizleme: çevre koyu, KAĞIT BEYAZ (en sonda — istisna re-assert) ── */
html.dark #doc-preview { background: #161616 !important; }
html.dark #doc-preview #sf-prev-notice {
  background: #0d0d0d !important;
  border-color: #494744 !important;
  color: #ffffff !important;
}
html.dark #doc-preview #sf-prev-notice > span { color: #ffffff !important; }
html.dark #doc-preview section.docx { background: #ffffff !important; box-shadow: 0 4px 24px -4px rgba(0,0,0,.6) !important; }
/* Kağıt içinde bizim hex'lerimizle çakışan inline stil olursa ORİJİNALİNE geri yükle (daha yüksek özgüllük + sonda) */
html.dark #doc-preview section.docx [style*="color:#2b2b29"] { color: #2b2b29 !important; }
html.dark #doc-preview section.docx [style*="color:#1a1c1c"] { color: #1a1c1c !important; }
html.dark #doc-preview section.docx [style*="color:#737970"] { color: #737970 !important; }
html.dark #doc-preview section.docx [style*="color:#9a9a96"] { color: #9a9a96 !important; }
html.dark #doc-preview section.docx [style*="color:#5a5648"] { color: #5a5648 !important; }
html.dark #doc-preview section.docx [style*="color:#5a5a57"] { color: #5a5a57 !important; }
html.dark #doc-preview section.docx [style*="color:#7E7E80"] { color: #7E7E80 !important; }
html.dark #doc-preview section.docx [style*="background:#fff"], html.dark #doc-preview section.docx [style*="background: #fff"] { background-color: #fff !important; }
/* KPI/kazanç terracotta barları (koyu modda bir ton açık) */
html.dark [style*="background:#963A20"] { background-color: #B4634A !important; }
html.dark [style*="background-color: #963A20"] { background-color: #B4634A !important; }
html.dark [style*="background:rgba(150,58,32,.10)"] { background-color: rgba(227,183,158,.14) !important; }
