/* ==========================================================
   Tatlı Bebek — Tema sistemi (Güncelleme 16)
   Bu bloktaki değişkenler tools/tema/tema-uret.py ile üretilir.
   Varsayılan (Gündüz) değerleri sitenin özgün renkleridir.
   Diğer temalar assets/css/themes/<tema>.css içinde aynı
   değişkenleri html[data-theme="..."] altında yeniden tanımlar.
   ========================================================== */
:root {
    --bd-b9d6ff: #b9d6ff;
    --bd-e3dde6: #e3dde6;
    --bd-e6eefa: #e6eefa;
    --bd-e9dfe6: #e9dfe6;
    --bd-eadfe4: #eadfe4;
    --bd-eef4ff: #eef4ff;
    --bd-f1e6ec: #f1e6ec;
    --bd-f2c9cf: #f2c9cf;
    --bd-f3edf0: #f3edf0;
    --bd-f6eef1: #f6eef1;
    --bd-f6eef2: #f6eef2;
    --bd-fbeef3: #fbeef3;
    --bd-ff9dbf: #ff9dbf;
    --bd-ffb3cc: #ffb3cc;
    --bd-ffc2c8: #ffc2c8;
    --bd-ffc7da: #ffc7da;
    --bd-ffe1ec: #ffe1ec;
    --bd-ffffff: #ffffff;
    --bd-ffffffcc: rgba(255, 255, 255, 0.8);
    --bg-c9e0ff: #c9e0ff;
    --bg-d2e4ffb2: rgba(210, 228, 255, 0.7);
    --bg-d6246e: #d6246e;
    --bg-e6187a: #e6187a;
    --bg-e9f6ff: #e9f6ff;
    --bg-f0f7ff: #f0f7ff;
    --bg-f2387c: #f2387c;
    --bg-f43f6e: #f43f6e;
    --bg-f4f8ff: #f4f8ff;
    --bg-f6f2f5: #f6f2f5;
    --bg-faf8fb: #faf8fb;
    --bg-fafafc: #fafafc;
    --bg-fbeef0: #fbeef0;
    --bg-fbf8fb: #fbf8fb;
    --bg-fcd8e6: #fcd8e6;
    --bg-fdeee9: #fdeee9;
    --bg-ff2f6d: #ff2f6d;
    --bg-ff3d6e: #ff3d6e;
    --bg-ff4f7b4c: rgba(255, 79, 123, 0.3);
    --bg-ff4f8b: #ff4f8b;
    --bg-ff5c8d: #ff5c8d;
    --bg-ff5d72: #ff5d72;
    --bg-ff5f6d: #ff5f6d;
    --bg-ff6a8e: #ff6a8e;
    --bg-ff6b8e: #ff6b8e;
    --bg-ff7a86: #ff7a86;
    --bg-ff94b8: #ff94b8;
    --bg-ffd2dce6: rgba(255, 210, 220, 0.9);
    --bg-ffd3e2: #ffd3e2;
    --bg-ffe0ea: #ffe0ea;
    --bg-ffe3ec: #ffe3ec;
    --bg-ffe3ee: #ffe3ee;
    --bg-ffe4f0e6: rgba(255, 228, 240, 0.9);
    --bg-ffe6ef: #ffe6ef;
    --bg-ffeef5: #ffeef5;
    --bg-fff0e4: #fff0e4;
    --bg-fff0f4: #fff0f4;
    --bg-fff0f5: #fff0f5;
    --bg-fff1e6: #fff1e6;
    --bg-fff1ea: #fff1ea;
    --bg-fff1f5: #fff1f5;
    --bg-fff2f3: #fff2f3;
    --bg-fff3f7: #fff3f7;
    --bg-fff4ea: #fff4ea;
    --bg-fff4f6: #fff4f6;
    --bg-fff4f8: #fff4f8;
    --bg-fff5f7: #fff5f7;
    --bg-fff6ef: #fff6ef;
    --bg-fff7f2: #fff7f2;
    --bg-fff7fa: #fff7fa;
    --bg-fff8f5: #fff8f5;
    --bg-fffafc: #fffafc;
    --bg-ffffff: #ffffff;
    --bg-ffffffb2: rgba(255, 255, 255, 0.7);
    --bg-ffffffe6: rgba(255, 255, 255, 0.9);
    --bg-ffffffeb: rgba(255, 255, 255, 0.92);
    --bg-fffffff2: rgba(255, 255, 255, 0.95);
    --bg-fffffff5: rgba(255, 255, 255, 0.96);
    --sh-78142833: rgba(120, 20, 40, 0.2);
    --sh-d6246e14: rgba(214, 36, 110, 0.08);
    --sh-d6246e1f: rgba(214, 36, 110, 0.12);
    --sh-d6246e24: rgba(214, 36, 110, 0.14);
    --sh-d6246e26: rgba(214, 36, 110, 0.15);
    --sh-d6246e42: rgba(214, 36, 110, 0.26);
    --sh-d6246e47: rgba(214, 36, 110, 0.28);
    --sh-e6187a40: rgba(230, 24, 122, 0.25);
    --sh-e6187a47: rgba(230, 24, 122, 0.28);
    --sh-e6187a4c: rgba(230, 24, 122, 0.3);
    --sh-e6187a52: rgba(230, 24, 122, 0.32);
    --sh-e6187a5c: rgba(230, 24, 122, 0.36);
    --sh-e94a5b1a: rgba(233, 74, 91, 0.1);
    --sh-f0607a59: rgba(240, 96, 122, 0.35);
    --sh-f2387c: #f2387c;
    --sh-f8606f59: rgba(248, 96, 111, 0.35);
    --sh-f8606f5c: rgba(248, 96, 111, 0.36);
    --sh-ff3d6e47: rgba(255, 61, 110, 0.28);
    --sh-ff3d6e52: rgba(255, 61, 110, 0.32);
    --sh-ff4f7b: #ff4f7b;
    --sh-ff4f7b1f: rgba(255, 79, 123, 0.12);
    --sh-ff4f7b2e: rgba(255, 79, 123, 0.18);
    --sh-ff5f6d4c: rgba(255, 95, 109, 0.3);
    --tx-1f2a5a: #1f2a5a;
    --tx-1f6b54: #1f6b54;
    --tx-24285a: #24285a;
    --tx-2c3150: #2c3150;
    --tx-2f8cf0: #2f8cf0;
    --tx-3c4470: #3c4470;
    --tx-4b5275: #4b5275;
    --tx-4f5578: #4f5578;
    --tx-59618a: #59618a;
    --tx-5b6285: #5b6285;
    --tx-5f6582: #5f6582;
    --tx-7c3aed: #7c3aed;
    --tx-8a8fa8: #8a8fa8;
    --tx-9aa0b8: #9aa0b8;
    --tx-a6a9bd: #a6a9bd;
    --tx-b33131: #b33131;
    --tx-c81e66: #c81e66;
    --tx-c8235f: #c8235f;
    --tx-d6246e: #d6246e;
    --tx-ff2f57: #ff2f57;
    --tx-ff4f6b: #ff4f6b;
    --tx-ff4f7b: #ff4f7b;
    --tx-ff6b45: #ff6b45;
    --tx-ff7a59: #ff7a59;
    --tx-ffb703: #ffb703;
    --tx-ffd23f: #ffd23f;
    --tx-pink-500: #c4284f;
    --tx-pink-600: #c4284f;
    --tx-blue-500: var(--blue-500);
    --tx-blue-600: var(--blue-600);
    --tx-tone-pink-fg: #c52165;
    --tx-tone-coral-fg: var(--tone-coral-fg);
    --tx-tone-blue-fg: #1b66c6;
    --tx-tone-peach-fg: var(--tone-peach-fg);
    --tx-tone-lilac-fg: var(--tone-lilac-fg);
    --tx-tone-mint-fg: var(--tone-mint-fg);
    --tx-tone-yellow-fg: var(--tone-yellow-fg);
    --tx-tone-teal-fg: var(--tone-teal-fg);
    --tx-tone-red-fg: var(--tone-red-fg);
    --tb-page: #ffffff;
    --tb-surface: #ffffff;
    --tb-surface-2: #ffe3eb;
    --tb-line: #ffd8e3;
    --tb-ink: #2c3150;
    --tb-ink-soft: #5d6280;
    --tb-accent: #d6246e;
    --tb-accent-ink: #d6246e;
}

/* ==========================================================
   "Görünümünü Seç" penceresi (tema seçici)
   ========================================================== */
.theme-toggle .icon { width: 23px; height: 23px; }
.theme-dialog {
    width: min(560px, calc(100vw - 24px)); max-width: none; max-height: min(88vh, 760px); max-height: min(88dvh, 760px);
    padding: 0; border: 1px solid var(--tb-line); border-radius: 26px; overflow: hidden;
    background: var(--tb-surface); color: var(--tb-ink); box-shadow: 0 24px 70px rgba(20, 16, 40, .28);
}
.theme-dialog:not([open]) { display: none; }
.theme-dialog[open] { display: flex; animation: tb-pop .22s var(--ease); }
.theme-dialog::backdrop { background: rgba(20, 22, 40, .48); backdrop-filter: blur(3px); }
.theme-dialog.is-fallback { position: fixed; inset: 0; margin: auto; z-index: 300; height: fit-content; }
@keyframes tb-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .theme-dialog[open] { animation: none; } }
.theme-dialog__inner { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.theme-dialog__head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 14px; border-bottom: 1px solid var(--tb-line); }
.theme-dialog__icon { width: 46px; height: 46px; border-radius: 15px; flex-shrink: 0; display: grid; place-items: center; background: var(--tb-surface-2); color: var(--tb-accent-ink); }
.theme-dialog__icon .icon { width: 25px; height: 25px; }
.theme-dialog__title { margin: 0; font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; color: var(--tb-ink); }
.theme-dialog__desc { margin: 3px 0 0; font-size: .9rem; color: var(--tb-ink-soft); line-height: 1.45; }
.theme-dialog__close { margin-left: auto; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--tb-line); background: var(--tb-surface); color: var(--tb-ink); display: grid; place-items: center; cursor: pointer; }
.theme-dialog__close:hover { background: var(--tb-surface-2); }
.theme-dialog__close .icon { width: 20px; height: 20px; }

.theme-grid { margin: 0; padding: 16px 20px; border: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-card { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: 18px;
    border: 2px solid var(--tb-line); background: var(--tb-surface); cursor: pointer; transition: border-color .15s, background-color .15s, transform .15s; }
.theme-card:hover { border-color: var(--tb-accent); transform: translateY(-1px); }
.theme-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.theme-card:has(input:focus-visible) { outline: 3px solid var(--tb-accent); outline-offset: 2px; }
.theme-card.is-checked { border-color: var(--tb-accent); background: var(--tb-surface-2); }
.theme-card__swatch { position: relative; width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; overflow: hidden;
    background: linear-gradient(135deg, var(--sw-bg) 0 48%, var(--sw-mid) 48% 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.theme-card__swatch i { position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--sw-acc); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.theme-card__name { min-width: 0; font-weight: 800; font-size: .95rem; line-height: 1.25; color: var(--tb-ink); overflow-wrap: break-word; hyphens: manual; }
.theme-card__name small { display: block; font-weight: 600; font-size: .74rem; color: var(--tb-ink-soft); }
.theme-card__check { margin-left: auto; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid var(--tb-line); color: transparent; transition: background-color .15s, border-color .15s; }
.theme-card__check .icon { width: 16px; height: 16px; stroke-width: 3; }
.theme-card.is-checked .theme-card__check { background: var(--tb-accent); border-color: var(--tb-accent); color: #fff; }

.theme-dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 20px 18px; border-top: 1px solid var(--tb-line); }
.theme-dialog__reset, .theme-dialog__done { min-height: 44px; padding: 0 18px; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.theme-dialog__reset { background: transparent; color: var(--tb-ink); border: 2px solid var(--tb-line); }
.theme-dialog__reset:hover { border-color: var(--tb-accent); }
.theme-dialog__done { background: var(--tb-accent); color: #fff; border: 0; }
.theme-dialog__reset:focus-visible, .theme-dialog__done:focus-visible, .theme-dialog__close:focus-visible { outline: 3px solid var(--tb-accent); outline-offset: 2px; }

/* Yan menüdeki "Görünümünü Seç" satırı */
.drawer__btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line);
    background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.drawer__btn:hover { background: var(--pink-50); color: var(--tx-pink-600); }
.drawer__btn em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--muted); }

@media (max-width: 420px) {
    .theme-dialog { width: calc(100vw - 16px); border-radius: 22px; }
    .theme-dialog__head { padding: 16px 14px 12px; gap: 10px; }
    .theme-dialog__icon { display: none; }
    .theme-grid { padding: 12px 14px; gap: 8px; }
    .theme-card { padding: 8px; gap: 8px; border-radius: 15px; }
    .theme-card__swatch { width: 36px; height: 36px; border-radius: 11px; }
    .theme-card__swatch i { width: 14px; height: 14px; right: 5px; bottom: 5px; }
    .theme-card__name { font-size: .86rem; }
    .theme-card { padding-right: 10px; }
    .theme-card__check { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; background: var(--tb-surface); }
    .theme-card:not(.is-checked) .theme-card__check { display: none; }
    .theme-card__name small { display: none; }
    .theme-dialog__title { font-size: 1.25rem; }
    .theme-dialog__desc { font-size: .84rem; }
    .theme-dialog__foot { padding: 12px 14px 14px; }
    .theme-dialog__reset, .theme-dialog__done { flex: 1; justify-content: center; padding: 0 10px; white-space: nowrap; font-size: .9rem; }
}
@media (max-width: 300px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } }
