/* ============================================================
   Tawny — "Ana ekrana ekle" rehberi (js/install-guide.js)
   Açılış sayfası, giriş sayfası ve uygulamada aynı alt sayfa.
   Uygulamanın tema değişkenleri varsa onları kullanır, yoksa siyah-beyaz.
   ============================================================ */

/* Düğme görünürlüğü: telefonda ve ana ekrandan açılmamışken */
.ti-only { display: none !important; }
html.ti-can .ti-only { display: inline-flex !important; }
html.ti-can .ti-hide { display: none !important; }

.ti-back {
    position: fixed; inset: 0; z-index: 10050; background: rgba(0, 0, 0, .58);
    opacity: 0; transition: opacity .22s ease;
}
.ti-back.on { opacity: 1; }

.ti-sheet {
    --ti-bg: var(--bg-secondary, #0e0e10);
    --ti-ink: var(--text-primary, #fff);
    --ti-sub: var(--text-secondary, rgba(255, 255, 255, .62));
    --ti-line: rgba(255, 255, 255, .08);
    --ti-card: rgba(255, 255, 255, .045);
    position: fixed; z-index: 10051; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain;
    padding: 8px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 26px 26px 0 0; background: var(--ti-bg); color: var(--ti-ink);
    border: 1px solid var(--ti-line); border-bottom: 0; box-shadow: 0 -18px 50px rgba(0, 0, 0, .55);
    font-family: inherit; font-size: 15px; line-height: 1.4; text-align: left; -webkit-text-size-adjust: 100%;
    transform: translateY(105%); transition: transform .32s cubic-bezier(.22, 1, .36, 1);
}
.ti-sheet.on { transform: none; }
.ti-sheet.ti-drag { transition: none; }
@media (min-width: 640px) and (min-height: 560px) {
    .ti-sheet { bottom: auto; top: 50%; border-radius: 24px; border-bottom: 1px solid var(--ti-line); transform: translateY(-46%) scale(.97); opacity: 0; transition: transform .26s cubic-bezier(.22, 1, .36, 1), opacity .2s; }
    .ti-sheet.on { transform: translateY(-50%); opacity: 1; }
    .ti-grip { visibility: hidden; }
}
.ti-sheet *, .ti-sheet *::before, .ti-sheet *::after { box-sizing: border-box; }
.ti-grip { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); margin: 2px auto 12px; }
.ti-x {
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center;
    background: rgba(255, 255, 255, .08); color: var(--ti-ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ti-x svg { width: 16px; height: 16px; }

/* Üst: simge, başlık, artılar */
.ti-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.ti-app { width: 58px; height: 58px; flex: none; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 20px rgba(0, 0, 0, .5); }
.ti-title { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--ti-ink); }
.ti-sub { margin: 3px 0 0; font-size: 13.5px; color: var(--ti-sub); }
.ti-perks { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.ti-perks li { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--ti-card); border: 1px solid var(--ti-line); font-size: 12.5px; font-weight: 600; color: var(--ti-ink); }
.ti-perks svg { width: 13px; height: 13px; opacity: .8; }

/* Platform ve tarayıcı seçimi */
.ti-seg { display: flex; gap: 4px; margin: 16px 0 0; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.ti-seg button {
    flex: 1; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ti-sub); font: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s;
}
.ti-seg button.on { background: var(--ti-ink); color: #000; }
.ti-browsers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 12.5px; color: var(--ti-sub); }
.ti-browsers button {
    height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--ti-line); background: transparent; color: var(--ti-sub);
    font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ti-browsers button.on { border-color: rgba(255, 255, 255, .5); color: var(--ti-ink); }

/* Tek dokunuşla yükleme (Android'de tarayıcı izin verince) */
.ti-install {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 52px; margin: 16px 0 0; border: 0; border-radius: 15px;
    background: #fff; color: #000; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ti-install svg { width: 20px; height: 20px; }
.ti-install:active { transform: scale(.98); }
.ti-or { margin: 14px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--ti-sub); }

/* Adımlar */
.ti-steps { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ti-step {
    display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 13px 14px; border-radius: 16px;
    background: var(--ti-card); border: 1px solid var(--ti-line);
    opacity: 0; transform: translateY(8px); animation: tiIn .38s cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes tiIn { to { opacity: 1; transform: none; } }
.ti-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 800; color: var(--ti-ink); }
.ti-step-t { font-size: 14.5px; font-weight: 600; color: var(--ti-ink); padding-top: 3px; }
.ti-step-t b { font-weight: 800; }
.ti-step-s { margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--ti-sub); }
.ti-step-s b { font-weight: 700; color: var(--ti-ink); }
.ti-ic { display: inline-grid; place-items: center; width: 24px; height: 22px; margin: 0 2px; border-radius: 7px; background: rgba(255, 255, 255, .14); vertical-align: -5px; }
.ti-ic svg { width: 15px; height: 15px; }
.ti-vis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }

/* Sistemdeki düğmelerin küçük benzerleri */
.ti-m-btn { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--ti-ink); position: relative; }
.ti-m-btn svg { width: 22px; height: 22px; }
.ti-step:first-child .ti-m-btn::after { content: ""; position: absolute; inset: -4px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .55); animation: tiPing 1.8s ease-out infinite; }
@keyframes tiPing { 0% { opacity: .9; transform: scale(.92); } 80%, 100% { opacity: 0; transform: scale(1.18); } }
.ti-m-row {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 210px; max-width: 100%; height: 44px; padding: 0 14px;
    border-radius: 12px; background: rgba(255, 255, 255, .1); font-size: 14.5px; font-weight: 600; color: var(--ti-ink);
}
.ti-m-row svg { width: 20px; height: 20px; flex: none; }
.ti-m-pill { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 16px; background: #fff; color: #000; font-size: 14px; font-weight: 800; }
.ti-m-tog { width: 44px; height: 26px; border-radius: 13px; background: #fff; position: relative; flex: none; }
.ti-m-tog::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #000; }
.ti-copy {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--ti-line);
    background: rgba(255, 255, 255, .06); color: var(--ti-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.ti-copy svg { width: 16px; height: 16px; }

.ti-note { display: flex; gap: 8px; margin: 14px 2px 0; font-size: 12.5px; color: var(--ti-sub); }
.ti-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; opacity: .8; }
.ti-done {
    display: block; width: 100%; height: 50px; margin: 14px 0 0; border: 0; border-radius: 15px; background: rgba(255, 255, 255, .1);
    color: var(--ti-ink); font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent;
}

/* Uygulamada bir kez çıkan küçük öneri kartı */
.ti-promo {
    position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--ti-promo-bottom, 16px) + env(safe-area-inset-bottom, 0px));
    margin: 0 auto; max-width: 480px; display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 12px; border-radius: 20px;
    background: color-mix(in srgb, var(--bg-secondary, #111) 92%, transparent); border: 1px solid rgba(255, 255, 255, .1); color: var(--text-primary, #fff);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
    transform: translateY(calc(100% + 40px)); opacity: 0; transition: transform .36s cubic-bezier(.22, 1, .36, 1), opacity .25s;
}
.ti-promo.on { transform: none; opacity: 1; }
body.tm-mobile .ti-promo { bottom: calc(var(--tm-bottom, 96px) + 4px); }
body.tm-mobile:not([data-tm-screen="chats"]) .ti-promo { display: none; }
.ti-promo img { width: 44px; height: 44px; border-radius: 11px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.ti-promo-t { flex: 1; min-width: 0; line-height: 1.25; }
.ti-promo-t b { display: block; font-size: 14.5px; font-weight: 800; }
.ti-promo-t span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-secondary, rgba(255, 255, 255, .62)); }
.ti-promo-go { height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: #fff; color: #000; font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; flex: none; }
.ti-promo-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary, rgba(255, 255, 255, .62)); display: grid; place-items: center; cursor: pointer; flex: none; }
.ti-promo-x svg { width: 15px; height: 15px; }

/* Bilgi baloncuğu (eklendi / kopyalandı) */
.ti-toast {
    position: fixed; z-index: 10060; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0;
    padding: 10px 16px; border-radius: 14px; background: #fff; color: #000; font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    transition: transform .25s, opacity .2s; pointer-events: none; white-space: nowrap;
}
.ti-toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .ti-sheet, .ti-promo, .ti-back { transition: none; }
    .ti-step { animation: none; opacity: 1; transform: none; }
    .ti-step:first-child .ti-m-btn::after { animation: none; opacity: 0; }
}
