/* Loppz AI — tasarım sistemi
 * Kurumsal, kompakt, sakin yüzeyler + yapay zekâ anlarında canlı gradyan.
 * Açık tema varsayılan; koyu tema [data-theme="dark"]. Yazı tipi: Inter. */

:root {
    color-scheme: light;
    --bg: #FFFFFF;
    --bg-2: #F8F9FB;
    --surface: #FFFFFF;
    --surface-2: #F7F8FA;
    --sunken: #F0F2F5;
    --side: #F7F8FA;
    --hover: rgba(15, 23, 42, .05);
    --ink: #0F1115;
    --on-ink: #FFFFFF;
    --text: #1F2328;
    --muted: #5F6672;
    --faint: #8F96A3;
    --line: #E7E9EE;
    --line-2: #D9DCE3;
    --accent: #3B6CF6;
    --accent-2: #2F5BE0;
    --accent-soft: rgba(59, 108, 246, .1);
    --accent-ring: rgba(59, 108, 246, .25);
    --ai-1: #4285F4;
    --ai-2: #9B72CB;
    --ai-3: #D96570;
    --ai-grad: linear-gradient(90deg, #4285F4 0%, #9B72CB 52%, #D96570 100%);
    --ai-grad-soft: linear-gradient(135deg, rgba(66,133,244,.12), rgba(155,114,203,.12) 50%, rgba(217,101,112,.12));
    --ok: #12A150;
    --ok-soft: rgba(18, 161, 80, .1);
    --warn: #B26A00;
    --warn-soft: rgba(178, 106, 0, .1);
    --bad: #D93036;
    --bad-soft: rgba(217, 48, 54, .09);
    --glass: rgba(255, 255, 255, .8);
    --scrim: rgba(15, 17, 21, .35);
    --shadow-1: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-2: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px -6px rgba(15, 23, 42, .1);
    --shadow-3: 0 2px 6px rgba(15, 23, 42, .05), 0 20px 44px -16px rgba(15, 23, 42, .2);
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --serif: var(--font);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --side-w: 260px;
    --top-h: 54px;
    --tab-h: 74px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #131314;
    --bg-2: #18191B;
    --surface: #1E1F21;
    --surface-2: #232427;
    --sunken: #282A2D;
    --side: #1A1B1D;
    --hover: rgba(255, 255, 255, .06);
    --ink: #F2F3F5;
    --on-ink: #131314;
    --text: #E3E5E8;
    --muted: #A2A7B0;
    --faint: #737983;
    --line: #2B2D31;
    --line-2: #383B40;
    --accent: #7AA2FF;
    --accent-2: #94B4FF;
    --accent-soft: rgba(122, 162, 255, .14);
    --accent-ring: rgba(122, 162, 255, .3);
    --ai-grad-soft: linear-gradient(135deg, rgba(66,133,244,.2), rgba(155,114,203,.2) 50%, rgba(217,101,112,.2));
    --ok: #4ADE80;
    --ok-soft: rgba(74, 222, 128, .13);
    --warn: #FBBF24;
    --warn-soft: rgba(251, 191, 36, .13);
    --bad: #FF6B6B;
    --bad-soft: rgba(255, 107, 107, .13);
    --glass: rgba(19, 19, 20, .8);
    --scrim: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 20px -8px rgba(0, 0, 0, .6);
    --shadow-3: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 50px -18px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
/* Sayfanın üst/alt ucunda esneme (rubber-band) yok: Mac'te yapışkan, bulanık arka planlı üst barlar
   esneme sırasında her karede yeniden çizilip titriyordu. Görünüm alanı bu ayarı html'den okur. */
html { -webkit-text-size-adjust: 100%; height: 100%; background: var(--bg); overscroll-behavior: none; }
body {
    margin: 0; min-height: 100%;
    font-family: var(--font); font-size: 14.5px; line-height: 1.5; letter-spacing: -.006em;
    font-feature-settings: "cv11", "ss01", "ss03";
    background: var(--bg); color: var(--text);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, textarea, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
:focus:not(:focus-visible) { outline: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* Yapay zekâ gradyanı */
.grad-text, .serif em, em.serif {
    font-style: normal; background: var(--ai-grad); background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: grad-move 6s ease-in-out infinite;
}
@keyframes grad-move { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Giriş animasyonu (sayfa içerikleri) */
.enter > * { animation: enter .55s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .05s; }
.enter > *:nth-child(3) { animation-delay: .1s; }
.enter > *:nth-child(4) { animation-delay: .15s; }
.enter > *:nth-child(5) { animation-delay: .2s; }
.enter > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

/* Gemini tarzı düşünme işareti */
.spark { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; }
.spark svg { width: 22px; height: 22px; stroke: none; fill: url(#mf-g); }
.spark.busy svg { animation: spark-spin 1.6s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes spark-spin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.82); } 100% { transform: rotate(360deg) scale(1); } }
.shimmer-text { background: linear-gradient(90deg, var(--faint) 0%, var(--faint) 40%, var(--ink) 50%, var(--faint) 60%, var(--faint) 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer-t 2s linear infinite; }
@keyframes shimmer-t { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Tema geçişi */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2147483646; }
.theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after { transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s !important; }

.theme-toggle { position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); transition: background .2s, color .2s, transform .2s var(--ease); }
.theme-toggle:hover { background: var(--hover); color: var(--ink); }
.theme-toggle:active { transform: scale(.9); }
.theme-toggle.boxed { border: 1px solid var(--line); background: var(--surface); }
.theme-toggle svg { grid-area: 1 / 1; width: 18px; height: 18px; transition: transform .55s var(--ease), opacity .3s; }
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
.theme-toggle .moon { opacity: 1; transform: none; }
[data-theme="dark"] .theme-toggle .sun { opacity: 1; transform: none; }
[data-theme="dark"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(.4); }

/* Marka */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15.5px; letter-spacing: -.02em; color: var(--ink); }
.brand i { font-style: normal; font-weight: 650; background: var(--ai-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark {
    display: inline-block; flex: none; width: 24px; height: 24px; background: var(--ai-grad);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5c.7 5.9 3.8 9 10.5 10.5C15.8 13.5 12.7 16.6 12 22.5 11.3 16.6 8.2 13.5 1.5 12 8.2 10.5 11.3 7.4 12 1.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5c.7 5.9 3.8 9 10.5 10.5C15.8 13.5 12.7 16.6 12 22.5 11.3 16.6 8.2 13.5 1.5 12 8.2 10.5 11.3 7.4 12 1.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.brand-mark svg { display: none; }

/* Düğmeler */
.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent;
    font-weight: 550; font-size: 14px; white-space: nowrap; user-select: none; overflow: hidden;
    transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { opacity: .88; }
.btn-accent { color: #fff; background: var(--accent); }
.btn-accent:hover { background: var(--accent-2); }
.btn-ai { color: #fff; background: var(--ai-grad); background-size: 160% 100%; transition: background-position .5s var(--ease), transform .2s var(--ease); }
.btn-ai:hover { background-position: 100% 0; }
.btn-ghost, .btn-light { border-color: var(--line-2); background: var(--surface); color: var(--text); }
.btn-ghost:hover, .btn-light:hover { background: var(--hover); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-quiet { color: var(--muted); }
.btn-quiet:hover { background: var(--hover); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); transition: background .2s, color .2s, transform .2s var(--ease); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 19px; height: 19px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: .8; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Form */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 550; color: var(--text); }
.input, .select, .textarea {
    width: 100%; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
    padding: 10px 13px; font-size: 15px; color: var(--text); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F96A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 15px; }
.textarea { resize: none; line-height: 1.55; }

.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; transition: all .2s var(--ease); }
.chip svg { width: 15px; height: 15px; }
.chip:hover { color: var(--ink); background: var(--hover); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.card { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); padding: 18px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--sunken); color: var(--muted); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.h1 { font-size: 22px; font-weight: 650; letter-spacing: -.025em; margin: 0; line-height: 1.25; color: var(--ink); }
.h2 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; margin: 0; line-height: 1.3; color: var(--ink); }

.meter { height: 4px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ai-grad); transition: width .8s var(--ease); }

.skeleton { position: relative; overflow: hidden; background: var(--sunken); border-radius: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 65%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { display: grid; place-items: center; text-align: center; gap: 6px; padding: 44px 20px; color: var(--muted); font-size: 13.5px; }
.empty svg { width: 28px; height: 28px; color: var(--faint); margin-bottom: 4px; }
.empty b { color: var(--ink); font-weight: 600; font-size: 14.5px; }

/* ---------- Uygulama kabuğu: yan menü ---------- */
.side {
    position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--side-w);
    display: flex; flex-direction: column; padding: 10px 8px 8px;
    background: var(--side); border-right: 1px solid var(--line);
    transition: width .3s var(--ease);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 40px; padding: 0 2px 0 8px; margin-bottom: 8px; }
.side-head .brand { min-width: 0; font-size: 15px; gap: 8px; }
.side-head .brand-mark { width: 22px; height: 22px; }
.side-collapse { width: 32px; height: 32px; border-radius: 8px; }
.side-collapse svg { width: 18px; height: 18px; }
.side-nav { display: grid; gap: 1px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 9px; border-radius: 9px; color: var(--text); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .15s, color .15s; }
.nav-item svg { width: 17px; height: 17px; color: var(--muted); transition: color .15s; }
.nav-item:hover { background: var(--hover); }
.nav-item:hover svg { color: var(--ink); }
.nav-item.on { background: var(--sunken); color: var(--ink); font-weight: 600; }
.nav-item.on svg { color: var(--accent); }
.nav-item.new { margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.nav-item.new svg { color: var(--ink); }
.nav-item .tag { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 6px; border-radius: 6px; background: var(--ai-grad-soft); color: var(--ai-2); }
.side-label { margin: 14px 9px 4px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 10px -4px 0; padding: 0 4px 8px; border-top: 1px solid var(--line); padding-top: 10px; scrollbar-width: thin; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-foot { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }

.usage { display: block; padding: 10px 10px 9px; border-radius: 12px; transition: background .15s; }
.usage:hover { background: var(--hover); }
.usage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.usage-label { font-size: 12px; font-weight: 550; color: var(--muted); }
.usage-top b { font-size: 14px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.usage .meter { margin-top: 7px; height: 4px; background: var(--sunken); }
.usage-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 11.5px; color: var(--faint); }
.usage-sub span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upgrade { flex: none; font-weight: 650; background: var(--ai-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.user-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 12px; text-align: left; transition: background .15s; }
.user-row:hover, .user-row[aria-expanded="true"] { background: var(--hover); }
.avatar { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ai-grad); color: #fff; font-weight: 650; font-size: 11.5px; letter-spacing: .02em; }
.user-row > .sx { min-width: 0; flex: 1; }
.user-row b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.user-row small { display: block; margin-top: 2px; line-height: 1; }
.plan-chip { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--sunken); font-size: 10.5px; font-weight: 650; color: var(--muted); }
.plan-chip.paid { background: var(--ai-grad); color: #fff; }
.user-row .chev { display: grid; place-items: center; color: var(--faint); }
.user-row .chev svg { width: 15px; height: 15px; }

.umenu { position: fixed; z-index: 70; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: umenu-in .22s var(--ease); }
@keyframes umenu-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.umenu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.umenu-head > div { min-width: 0; }
.umenu-head b { display: block; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.umenu-head small { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.umenu a, .umenu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 9px; border-radius: 9px; font-size: 13.5px; color: var(--text); text-align: left; }
.umenu a svg, .umenu button svg { width: 16px; height: 16px; color: var(--muted); }
.umenu a:hover, .umenu button:hover { background: var(--hover); }
.umenu .danger { color: var(--bad); }
.umenu .danger svg { color: var(--bad); }
.umenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

/* Masaüstünde daraltılmış menü */
@media (min-width: 900px) {
    html.side-collapsed { --side-w: 60px; }
    html.side-collapsed .side .sx, html.side-collapsed .side .tag, html.side-collapsed .side-scroll, html.side-collapsed .usage { display: none !important; }
    html.side-collapsed .side-head { flex-direction: column; height: auto; gap: 6px; padding: 2px 0 6px; }
    html.side-collapsed .side-head .brand { padding: 4px; }
    html.side-collapsed .nav-item { justify-content: center; padding: 0; }
    html.side-collapsed .side-nav { gap: 4px; }
    html.side-collapsed .side-foot { margin-top: auto; }
    html.side-collapsed .user-row { justify-content: center; padding: 6px 0; }
}

.main { min-height: 100vh; min-height: 100dvh; padding-left: var(--side-w); display: flex; flex-direction: column; background: var(--bg); transition: padding-left .3s var(--ease); }

.topbar {
    display: none; position: sticky; top: 0; z-index: 25; align-items: center; gap: 2px;
    height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0;
    background: var(--glass); border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.topbar-title { font-size: 16px; font-weight: 650; letter-spacing: -.02em; margin-right: auto; display: flex; align-items: center; min-width: 0; padding-left: 4px; color: var(--ink); }
.topbar-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit-pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.credit-pill svg { width: 13px; height: 13px; fill: var(--ai-2); stroke: none; }

.tabs {
    display: none; position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
    height: 60px; padding: 5px; grid-template-columns: repeat(4, 1fr); gap: 2px;
    background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
    box-shadow: var(--shadow-3); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 17px; color: var(--faint); font-size: 10.5px; font-weight: 600; transition: color .25s, background .25s; }
.tabs a svg { width: 21px; height: 21px; transition: transform .35s var(--spring); }
.tabs a.on { color: var(--accent); background: var(--accent-soft); }
.tabs a:active svg { transform: scale(.84); }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); display: grid; gap: 8px; width: min(400px, calc(100vw - 24px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-3); font-size: 13.5px; pointer-events: auto; animation: toast-in .4s var(--spring) both; }
.toast.out { animation: toast-out .25s var(--ease) forwards; }
.toast svg { margin-top: 1px; width: 17px; height: 17px; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--bad); }
.toast.info svg { color: var(--accent); }
.toast a { color: var(--accent); font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* ---------- Alt sayfa / modal ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .25s; }
.sheet-panel { position: relative; width: min(500px, calc(100vw - 32px)); max-height: min(84vh, 720px); overflow: auto; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-3); padding: 20px; opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .25s var(--ease), transform .35s var(--spring); }
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-scrim { opacity: 1; }
.sheet.open .sheet-panel { opacity: 1; transform: none; }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-head .icon-btn { margin: -6px -6px -6px 0; }

.lightbox { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-top { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: calc(10px + var(--safe-t)) 12px 8px; }
.lightbox-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 16px; }
.lightbox-body img, .lightbox-body video { max-width: 100%; max-height: 100%; border-radius: 14px; object-fit: contain; box-shadow: var(--shadow-3); animation: zoom-in .4s var(--spring); }
@keyframes zoom-in { from { opacity: 0; transform: scale(.94); } }
.lightbox-cap { padding: 12px 18px calc(14px + var(--safe-b)); color: var(--muted); font-size: 13px; text-align: center; max-width: 720px; margin: 0 auto; }

.install { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); display: none; align-items: center; gap: 12px; padding: 11px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: toast-in .4s var(--spring); }
.install.show { display: flex; }
.install .brand-mark { width: 30px; height: 30px; margin: 0 4px; }
.install b { display: block; font-size: 13.5px; color: var(--ink); }
.install small { display: block; color: var(--muted); font-size: 12px; }
.install > div { flex: 1; min-width: 0; }
.ios-steps { display: grid; gap: 12px; margin: 6px 0 0; padding: 0; list-style: none; counter-reset: s; }
.ios-steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.ios-steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 12px; }
.ios-steps svg { display: inline; vertical-align: -4px; color: var(--accent); }
.offline-bar { position: fixed; z-index: 95; top: 0; left: 0; right: 0; padding: calc(6px + var(--safe-t)) 12px 6px; text-align: center; font-size: 12.5px; font-weight: 600; background: var(--ink); color: var(--on-ink); transform: translateY(-100%); transition: transform .3s var(--ease); }
.offline-bar.show { transform: none; }

/* ---------- Sayfa iskeleti ---------- */
.page { width: min(1160px, 100%); margin: 0 auto; padding: 26px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Mobil ---------- */
@media (max-width: 899px) {
    .side { transform: translateX(-100%); transition: transform .38s var(--ease); width: min(300px, 86vw); padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); box-shadow: var(--shadow-3); }
    .side-collapse { display: none; }
    .side { z-index: 55; }
    .side-dim { z-index: 54 !important; }
    .side.open { transform: none; }
    .side-dim { position: fixed; inset: 0; z-index: 29; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s; }
    .side-dim.open { opacity: 1; pointer-events: auto; }
    .main { padding-left: 0; padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
    .topbar { display: flex; }
    .tabs { display: grid; }
    .page { padding: 16px 14px 24px; }
    .sheet { place-items: end center; }
    .sheet-panel { width: 100%; max-height: 88vh; border-radius: 24px 24px 0 0; border-bottom: 0; padding: 8px 16px calc(18px + var(--safe-b)); transform: translateY(100%); opacity: 1; transition: transform .42s var(--ease); }
    .sheet.open .sheet-panel { transform: translateY(var(--drag, 0px)); }
    .sheet.dragging .sheet-panel { transition: none; }
    .sheet-grip { display: block; width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 3px; background: var(--line-2); }
}
@media (min-width: 900px) {
    .install { left: auto; right: 20px; bottom: 20px; width: 360px; }
    .side-dim { display: none; }
}
body.standalone .install { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Yan menü: arama ve sohbet geçmişi (her sayfada aynı) */
.side-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; margin: 0 2px 6px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--faint); font-size: 13px; font-weight: 400; transition: border-color .2s, box-shadow .2s; cursor: text; }
.side-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.side-search svg { width: 15px; height: 15px; }
.side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--text); padding: 0; }
.side-search input::placeholder { color: var(--faint); }
.side-search input::-webkit-search-cancel-button { display: none; }
.hist-group { margin: 12px 9px 4px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.hist-group:first-child { margin-top: 4px; }
.hist-empty { margin: 10px 9px; font-size: 12.5px; color: var(--faint); }
.hist-item { display: flex; align-items: center; gap: 2px; border-radius: 9px; transition: background .15s; }
.hist-item a { flex: 1; min-width: 0; padding: 7px 9px; font-size: 13px; font-weight: 400; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item:hover { background: var(--hover); }
.hist-item.on { background: var(--sunken); }
.hist-item.on a { font-weight: 550; }
.hist-item button { opacity: 0; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--faint); }
.hist-item:hover button { opacity: 1; }
.hist-item button:hover { color: var(--bad); }
.hist-item button svg { width: 14px; height: 14px; }
@media (pointer: coarse) { .hist-item button { opacity: 1; } }

/* Onay ve bildirme pencereleri */
.consent p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--text); }
.consent-list { padding: 10px 12px; border-radius: 12px; background: var(--ai-grad-soft); font-size: 12.5px !important; font-weight: 550; color: var(--ink) !important; }
.consent ul { margin: 4px 0 12px; padding-left: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.consent a, .report a { color: var(--accent); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.report-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.report-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.report-opt input { accent-color: var(--accent); }

/* Mobil uygulama / web'e özel öğeler */
html.native [data-web-only] { display: none !important; }
html.desktop-app [data-no-desktop] { display: none !important; }
html:not(.native) [data-native-only] { display: none !important; }

/* Model sağlayıcı logoları */
.mlogo { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); overflow: hidden; }
.mlogo svg { width: 64%; height: 64%; display: block; }
.mlogo-letter { font-size: 11px; font-weight: 700; color: var(--muted); }
[data-theme="dark"] .mlogo { background: var(--bg-2); }
.sel-brand { position: relative; }
.sel-brand > span { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); display: flex; pointer-events: none; }
.sel-brand > span:empty + .select { padding-left: 13px; }
.sel-brand .select { padding-left: 42px; }

/* Uygulamada "siteye git" penceresi */
.sheet-compact .sheet-head { display: none; }
.sheet-compact .sheet-panel { max-width: 400px; }
.site-prompt { text-align: center; padding: 10px 4px 2px; }
.site-prompt .sp-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--ai-grad-soft); animation: sp-pop .55s var(--spring) both; }
.site-prompt .sp-mark svg { width: 34px; height: 34px; stroke: none; animation: sp-spin 6s linear infinite; }
.site-prompt h3 { margin: 16px 0 6px; font-size: 18px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.site-prompt p { margin: 0 auto 20px; max-width: 300px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.site-prompt .sp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.site-prompt .sp-btns svg { width: 15px; height: 15px; margin-left: 4px; vertical-align: -2px; }
@keyframes sp-pop { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }
@keyframes sp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .site-prompt .sp-mark, .site-prompt .sp-mark svg { animation: none; } }

/* İç kaydırma alanları uca gelince sayfayı sürüklemesin, esnemesin */
.side-scroll, .sheet-body, .sheet-panel, .umenu, .pop, textarea, .m-list, [data-all] { overscroll-behavior: contain; }
