/* Font <link> ile base.html'de yükleniyor: @import, app.css indirilip
   ayrıştırılana kadar bekletip ek bir seri round-trip ekliyordu. */

:root {--gf-bg: #131314;
        --gf-surface: #1e1f20;
        --gf-surface-2: #282a2c;
        --gf-border: #3c4043;
        --gf-text: #e3e3e3;
        --gf-text-dim: #9aa0a6;
        --gf-green: #81c995;
        --gf-red: #f28b82;
        --gf-blue: #8ab4f8;}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background-color: var(--gf-bg); color: var(--gf-text);
    font-family: 'Google Sans', 'Roboto', -apple-system, sans-serif;
    font-size: 15px; line-height: 1.5;
}
.page { max-width: 1600px; margin: 0 auto; padding: 14px 24px 48px; overflow-x: hidden; }
h1, h2, h3, h4 { color: var(--gf-text); font-weight: 500; letter-spacing: 0; }
h4 { font-size: 1.05rem; margin: 18px 0 10px; }
a { color: inherit; }

/* Ana yerleşim: sol liste | orta içerik | sağ asistan */
.gf-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1400px) { .gf-layout { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 1000px) { .gf-layout { grid-template-columns: minmax(0, 1fr); } }


/* Detay sayfası: içerik + asistan */
.gf-layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .gf-layout-2 { grid-template-columns: minmax(0, 1fr); } }

/* Asistan sağ sütunda kendi içinde kayar; sayfa uzayınca üstte kalır */
#ai-panel {
    position: sticky; top: 14px; min-width: 0;
    max-height: calc(100vh - 28px); overflow-y: auto;
    background: var(--gf-surface); border: 1px solid var(--gf-border);
    border-radius: 16px; padding: 16px 18px;
}
#ai-panel .gf-side-title { margin-top: 0; }
#ai-panel textarea { resize: vertical; min-height: 62px; border-radius: 14px; }
/* Dar ekranda sağ sütun grid dışına düşer, tam genişlik alsın */
@media (max-width: 1400px) { #ai-panel { position: static; grid-column: 1 / -1; max-height: none; } }

/* ---------- Kontroller ---------- */
button, .btn {
    background-color: transparent; color: var(--gf-text);
    border: 1px solid var(--gf-border); border-radius: 100px;
    font-family: inherit; font-weight: 500; font-size: .85rem;
    padding: .45rem 1rem; cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
button:hover, .btn:hover { background-color: var(--gf-surface-2); border-color: #5f6368; }
button.primary, .btn.primary {
    background-color: var(--gf-blue); color: #062e6f; border: none; font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background-color: #a8c7fa; }
button:disabled { opacity: .5; cursor: not-allowed; }

input[type="text"], input[type="search"], select, textarea {
    background-color: var(--gf-surface-2); color: var(--gf-text);
    border: 1px solid transparent; border-radius: 24px;
    padding: 11px 16px; font-family: inherit; font-size: .92rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gf-blue); }
input::placeholder, textarea::placeholder { color: var(--gf-text-dim); }
select { border-radius: 28px; min-height: 46px; cursor: pointer; }
label { font-size: .78rem; color: var(--gf-text-dim); display: block; margin-bottom: 5px; }

/* ---------- Sekmeler ---------- */
.gf-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--gf-border); margin-bottom: 14px; }
.gf-tab {
    background: transparent; border: none; border-radius: 100px 100px 0 0;
    color: var(--gf-text-dim); font-size: .9rem; font-weight: 500;
    padding: 10px 16px; cursor: pointer; border-bottom: 3px solid transparent;
}
.gf-tab:hover { color: var(--gf-text); background: var(--gf-surface); }
.gf-tab.active { color: var(--gf-blue); border-bottom-color: var(--gf-blue); background: transparent; }

/* ---------- Tablolar ---------- */
.gf-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.gf-table th {
    text-align: left; color: var(--gf-text-dim); font-weight: 500; font-size: .75rem;
    text-transform: uppercase; letter-spacing: .04em;
    padding: 8px 10px; border-bottom: 1px solid var(--gf-border);
}
.gf-table td { padding: 9px 10px; border-bottom: 1px solid var(--gf-surface-2); }
.gf-table tbody tr:hover { background: var(--gf-surface); }
.gf-table-wrap { overflow-x: auto; }

/* ---------- Liste satırı butonu (izleme listesi) ---------- */
.gf-row-btn {
    display: block; width: 100%; text-align: left; background: transparent;
    border: none; border-radius: 8px; padding: 0; cursor: pointer;
}
.gf-row-btn:hover { background: var(--gf-surface); border: none; }


/* ---------- Açılır bölüm ---------- */
details.gf-details {
    background: var(--gf-surface); border: 1px solid var(--gf-border);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 12px;
}
details.gf-details > summary { cursor: pointer; font-weight: 500; list-style: none; }
details.gf-details > summary::-webkit-details-marker { display: none; }
details.gf-details > summary::after { content: " ⌄"; color: var(--gf-text-dim); float: right; }

/* ---------- Yükleniyor göstergesi (htmx) ---------- */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.gf-spinner {
    display: inline-block; width: 15px; height: 15px; vertical-align: -2px;
    border: 2px solid var(--gf-border); border-top-color: var(--gf-blue);
    border-radius: 50%; animation: gf-spin .7s linear infinite;
}
@keyframes gf-spin { to { transform: rotate(360deg); } }

/* ---------- Modal (teknik özet) ---------- */
.gf-modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.gf-modal {
    background: var(--gf-surface); border: 1px solid var(--gf-border); border-radius: 16px;
    max-width: 860px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 22px 26px;
}
.gf-modal-close { float: right; border: none; font-size: 1.1rem; padding: 2px 10px; }

.gf-flash { border-radius: 10px; padding: 10px 14px; font-size: .88rem; margin: 10px 0; }
.gf-flash.ok { background: rgba(129,201,149,.12); color: var(--gf-green); }
.gf-flash.err { background: rgba(242,139,130,.12); color: var(--gf-red); }
.gf-flash.info { background: var(--gf-surface-2); color: var(--gf-text-dim); }

/* ---------- app.py'den birebir taşınan görsel dil ---------- */
h1, h2, h3, h4 {color: var(--gf-text) !important; font-weight: 500 !important; letter-spacing: 0;}
/* ---------- Üst bar (logo + arama) ---------- */
    .gf-topbar {display: flex; align-items: center; gap: 20px;
        padding: 4px 0 14px 0; margin-bottom: 4px;}
.gf-logo {font-size: 1.55rem; font-weight: 400; color: var(--gf-text); white-space: nowrap;}
.gf-logo b {font-weight: 700; color: var(--gf-blue);}
/* ---------- Radio -> segment chip ---------- */
    div[role="radiogroup"] label {background-color: var(--gf-surface-2); border-radius: 100px;
        padding: 6px 14px; margin-right: 8px; border: 1px solid transparent;}
div[role="radiogroup"] label:hover {border-color: #5f6368;}
/* ---------- Piyasa kartları ---------- */
    .gf-cards {display: flex; gap: 12px; overflow-x: auto; padding: 14px 2px 6px 2px;}
.gf-cards::-webkit-scrollbar {height: 6px;}
.gf-cards::-webkit-scrollbar-thumb {background: var(--gf-border); border-radius: 3px;}
.gf-card {flex: 1 0 190px; min-width: 190px;
        background-color: var(--gf-surface);
        border: 1px solid var(--gf-border);
        border-radius: 12px;
        padding: 14px 14px 6px 14px;}
.gf-card:hover {background-color: var(--gf-surface-2);}
.gf-card-name {font-size: 0.9rem; color: var(--gf-text); font-weight: 500; margin-bottom: 8px;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.gf-card-price {font-size: 1.35rem; font-weight: 400; color: var(--gf-text); line-height: 1.2;}
.gf-card-abs {font-size: 0.8rem; color: var(--gf-text-dim); margin-top: 2px;}
.gf-card-chg {font-size: 0.95rem; font-weight: 500; margin-top: 4px;}
.gf-up {color: var(--gf-green);}
.gf-down {color: var(--gf-red);}
.gf-flat {color: var(--gf-text-dim);}
.gf-spark {margin-top: 6px;}
/* ---------- Sol panel listeleri ---------- */
    .gf-side-title {font-size: 1.15rem; font-weight: 400; color: var(--gf-text);
        padding: 6px 0 10px 4px; display: flex; align-items: center; gap: 8px;}
.gf-side-sub {font-size: 0.75rem; color: var(--gf-text-dim); text-transform: uppercase;
        letter-spacing: .6px; padding: 14px 4px 6px 4px;}
.gf-row {display: flex; align-items: center; justify-content: space-between;
        padding: 9px 10px; border-radius: 10px; gap: 10px;}
.gf-row:hover {background-color: var(--gf-surface-2);}
.gf-row-left {display: flex; flex-direction: column; min-width: 0;}
.gf-row-sym {font-size: 0.88rem; color: var(--gf-text); font-weight: 500;}
.gf-row-name {font-size: 0.72rem; color: var(--gf-text-dim); white-space: nowrap;
                   overflow: hidden; text-overflow: ellipsis; max-width: 110px;}
.gf-row-right {display: flex; align-items: center; gap: 10px;}
.gf-row-price {font-size: 0.85rem; color: var(--gf-text); text-align: right;}
.gf-row-chg {font-size: 0.78rem; font-weight: 500; min-width: 58px; text-align: right;}
.gf-empty {color: var(--gf-text-dim); font-size: 0.82rem; padding: 8px 4px;}
/* ---------- Haber / özet ---------- */
    .gf-panel {background-color: var(--gf-surface); border: 1px solid var(--gf-border);
        border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;}
.gf-panel h4 {margin: 0 0 10px 0; font-size: 1.05rem; font-weight: 500;}
.gf-news {padding: 12px 0; border-bottom: 1px solid var(--gf-border);}
.gf-news:last-child {border-bottom: none;}
.gf-news a {font-size: 0.9rem; color: var(--gf-text); text-decoration: none;
        font-weight: 500; display: block; line-height: 1.35;}
.gf-news a:hover {color: var(--gf-blue); text-decoration: underline;}
.gf-news-time {font-size: 0.72rem; color: var(--gf-text-dim); margin-top: 5px;}
.gf-source {font-size: 0.72rem; color: var(--gf-text-dim);}
/* ---------- Sinyal rozetleri ---------- */
    .gf-badge {display: inline-block; padding: 3px 10px; border-radius: 100px;
        font-size: 0.75rem; font-weight: 600;}
.gf-badge-buy {background: rgba(129,201,149,.15); color: var(--gf-green);}
.gf-badge-sell {background: rgba(242,139,130,.15); color: var(--gf-red);}
.gf-badge-wait {background: rgba(138,180,248,.15); color: var(--gf-blue);}
hr {border-color: var(--gf-border);}
.gf-divider {height: 1px; background: var(--gf-border); margin: 18px 0; border: none;}
/* Popup penceresi */
    div[role="dialog"] {background-color: var(--gf-surface) !important;
        border: 1px solid var(--gf-border) !important;
        border-radius: 20px !important;}

/* ---------- Haber kartları ---------- */
.gf-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.gf-news-card {
    display: block; text-decoration: none; background: var(--gf-surface);
    border: 1px solid var(--gf-border); border-radius: 14px; padding: 16px 18px;
    transition: background-color .15s, border-color .15s;
}
.gf-news-card:hover { background: var(--gf-surface-2); border-color: #5f6368; }
.gf-news-card-title { font-size: .95rem; line-height: 1.4; margin-bottom: 8px; }

/* ---------- Açılır liste (native ok yerine kendi okumuz) ---------- */
select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%239aa0a6'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
    padding-right: 44px; text-overflow: ellipsis;
}
select:hover { background-color: #303134; }
select[multiple] { background-image: none; padding-right: 16px; }


/* ---------- Günlük kayıt takvimi ---------- */
.gf-cal-head { display: flex; gap: 34px; margin: 16px 0 14px; }
.gf-cal-head div { display: flex; flex-direction: column; gap: 2px; }
.gf-cal-head b { font-size: 1.25rem; font-weight: 500; }

.gf-cal { display: flex; flex-direction: column; gap: 6px; }
.gf-cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.gf-cal-dow div {
    font-size: .72rem; color: var(--gf-text-dim); text-transform: uppercase;
    letter-spacing: .05em; padding: 0 4px 2px;
}
.gf-cal-cell {
    display: block; text-decoration: none; color: inherit;
    background: var(--gf-surface); border: 1px solid var(--gf-border);
    border-radius: 10px; padding: 8px 10px; min-height: 74px;
}
.gf-cal-cell.empty { background: transparent; border-color: transparent; }
.gf-cal-cell.weekend { background: transparent; }
.gf-cal-cell.today { border-color: var(--gf-blue); }
.gf-cal-cell.has-data:hover { background: var(--gf-surface-2); border-color: #5f6368; }
.gf-cal-cell.selected { background: var(--gf-surface-2); border-color: var(--gf-blue); }
.gf-cal-day { font-size: .95rem; font-weight: 500; }
.gf-cal-count { font-size: .72rem; color: var(--gf-text-dim); margin-top: 2px; }
.gf-cal-bar { display: flex; gap: 2px; margin-top: 8px; height: 4px; }
.gf-cal-bar span { border-radius: 2px; min-width: 0; }
.gf-cal-bar .al, .gf-cal-legend i.al { background: var(--gf-green); }
.gf-cal-bar .sat, .gf-cal-legend i.sat { background: var(--gf-red); }
.gf-cal-bar .bekle, .gf-cal-legend i.bekle { background: var(--gf-border); }
.gf-cal-legend { display: flex; gap: 18px; margin-top: 10px; font-size: .75rem; color: var(--gf-text-dim); }
.gf-cal-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: 2px; margin-right: 5px; }


/* "Benzer geçmiş" tıklanabilir bloğu */
.gf-similar {
    display: block; width: 100%; text-align: left; background: transparent;
    border: none; border-radius: 8px; padding: 2px 4px; margin: 0 -4px; cursor: pointer;
    color: inherit; font: inherit;
}
.gf-similar:hover { background: var(--gf-surface-2); border: none; }


.gf-news-src {
    display: inline-block; background: var(--gf-surface-2); color: var(--gf-text-dim);
    border-radius: 100px; padding: 2px 9px; margin-right: 8px; font-size: .68rem;
}

.gf-cal-note { font-size: .68rem; color: var(--gf-text-dim); margin-top: 4px; line-height: 1.25; }
.gf-cal-cell.weekend { background: transparent; border-style: dashed; }


/* ---------- Formasyon taraması ---------- */
.gf-pattern-wrap { position: relative; display: inline-block; max-width: 100%; }
.gf-pattern-img { display: block; width: 100%; height: auto; border-radius: 10px; }
.gf-pattern-box {
    position: absolute; border: 2px solid var(--gf-blue); border-radius: 4px;
    background: rgba(138,180,248,.10); pointer-events: none;
}
.gf-pattern-box span {
    position: absolute; top: -22px; left: -2px; white-space: nowrap;
    background: var(--gf-blue); color: #062e6f; font-size: .68rem; font-weight: 600;
    padding: 2px 7px; border-radius: 5px;
}



/* Kısa uyarı balonu (hız sınırı, bağlantı hatası vb.) */
.gf-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
    background: var(--gf-surface-2); color: var(--gf-text);
    border: 1px solid var(--gf-border); border-radius: 100px;
    padding: 11px 22px; font-size: .88rem; z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.gf-toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ================= Asistan paneli ================= */
#ai-panel {
    position: sticky; top: 14px; min-width: 0;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 28px);
    background: var(--gf-surface); border: 1px solid var(--gf-border);
    border-radius: 18px; padding: 0; overflow: hidden;
}
/* Uzun cevap sayfayı uzatmasın: panelin yüksekliği sabit, mesajlar kendi
   içinde kayar. Aksi halde tek uzun yanıt ana sayfayı metrelerce uzatıyordu. */
#ai-panel { height: clamp(420px, calc(100vh - 28px), 760px); }
@media (max-width: 1400px) {
    #ai-panel { position: static; grid-column: 1 / -1; height: 520px; }
}

.gf-ai-head {
    display: flex; align-items: center; gap: 11px;
    padding: 14px 16px; border-bottom: 1px solid var(--gf-border); flex: none;
}
.gf-ai-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-size: .95rem;
    background: linear-gradient(135deg, #8ab4f8, #c58af9);
}
.gf-ai-title { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.gf-ai-title b { font-size: .92rem; font-weight: 500; }
.gf-ai-title .gf-source { font-size: .72rem; }
.gf-ai-clear {
    margin-left: auto; border: none; background: transparent; color: var(--gf-text-dim);
    font-size: 1.05rem; padding: 4px 9px; border-radius: 50%; flex: none;
}
.gf-ai-clear:hover { background: var(--gf-surface-2); color: var(--gf-text); border: none; }

.gf-ai-body {
    flex: 1 1 auto; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px; min-height: 120px;
}
.gf-ai-body::-webkit-scrollbar { width: 8px; }
.gf-ai-body::-webkit-scrollbar-thumb { background: var(--gf-surface-2); border-radius: 4px; }

.gf-ai-hello { text-align: center; padding: 18px 6px 4px; }
.gf-ai-hello-title { font-size: .98rem; margin-bottom: 5px; }
.gf-ai-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.gf-ai-chips button {
    text-align: left; white-space: normal; line-height: 1.35;
    border-radius: 14px; padding: 10px 14px; font-size: .82rem;
    background: var(--gf-surface-2); border-color: transparent; color: var(--gf-text-dim);
}
.gf-ai-chips button:hover { background: #303134; color: var(--gf-text); border-color: var(--gf-border); }

.gf-bubble { border-radius: 16px; padding: 10px 14px; font-size: .86rem; line-height: 1.5; max-width: 94%; }
.gf-bubble.user {
    background: var(--gf-blue); color: #062e6f; align-self: flex-end;
    border-bottom-right-radius: 5px; font-weight: 500;
}
.gf-bubble.bot {
    background: var(--gf-surface-2); align-self: flex-start;
    border-bottom-left-radius: 5px;
}
/* pre-wrap yalnızca metin kutusunda: kapsayıcıda olunca şablonun kendi
   girintileri ve satır sonları balonun içinde boşluk olarak çiziliyordu. */
.gf-bubble-src { margin-top: 9px; }
.gf-bubble-src > summary {
    cursor: pointer; font-size: .72rem; color: var(--gf-text-dim); list-style: none;
}
.gf-bubble-src > summary::-webkit-details-marker { display: none; }
.gf-bubble-src > summary::before { content: "🔗 "; }
.gf-bubble-src a {
    display: block; font-size: .73rem; color: var(--gf-blue);
    text-decoration: none; margin-top: 4px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}
.gf-bubble-src a:hover { text-decoration: underline; }

/* Yazıyor balonu: noktalar + durum yazısı */
.gf-thinking { display: none; align-items: center; gap: 9px; width: fit-content; }
.htmx-request .gf-thinking, .gf-thinking.htmx-request { display: flex; }
.gf-thinking-text { font-size: .78rem; color: var(--gf-text-dim); }
.gf-dots { display: inline-flex; gap: 4px; align-items: center; }
.gf-dots span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--gf-text-dim);
    animation: gf-blink 1.2s infinite both;
}
.gf-dots span:nth-child(2) { animation-delay: .2s; }
.gf-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes gf-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.gf-ai-form {
    display: flex; align-items: flex-end; gap: 8px; flex: none;
    padding: 12px 14px; border-top: 1px solid var(--gf-border); background: var(--gf-surface);
}
.gf-ai-form textarea {
    flex: 1; resize: none; min-height: 40px; max-height: 120px;
    border-radius: 20px; padding: 10px 15px; font-size: .86rem; line-height: 1.4;
    background: var(--gf-surface-2); border: 1px solid transparent;
}
.gf-ai-form button {
    flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%;
    background: var(--gf-blue); color: #062e6f; border: none;
    font-size: 1.05rem; font-weight: 700; line-height: 1;
}
.gf-ai-form button:hover { background: #a8c7fa; }
.gf-ai-form button:disabled { opacity: .45; }

.gf-ai-empty { padding: 16px; }
.gf-ai-quota {
    flex: none; padding: 8px 16px 12px; font-size: .73rem; color: var(--gf-text-dim);
    border-top: 1px solid var(--gf-border);
}


/* Yanıtın hangi sorgularla arandığı — gerçek groundingMetadata verisi */
.gf-bubble-search {
    font-size: .72rem; color: var(--gf-text-dim); margin-bottom: 7px;
    padding-bottom: 6px; border-bottom: 1px solid var(--gf-border);
}
.gf-bubble-text { overflow-wrap: anywhere; }
.gf-bubble-text p { margin: 0 0 8px; }
.gf-bubble-text p:last-child { margin-bottom: 0; }
.gf-bubble-text ul { margin: 0 0 8px; padding-left: 18px; }
.gf-bubble-text li { margin-bottom: 4px; }
.gf-bubble-text li:last-child { margin-bottom: 0; }
.gf-bubble-text strong { font-weight: 600; color: var(--gf-text); }
.gf-bubble-text em { color: var(--gf-text-dim); font-style: normal; }

/* ================= Mobil ================= */
@media (max-width: 720px) {
    .page { padding: 10px 14px 32px; }
    body { font-size: 14px; }

    .gf-topbar { flex-wrap: wrap; gap: 10px; padding-bottom: 10px; }
    .gf-logo { font-size: 1.25rem; }
    /* Satır içi style="flex:1" bu kuralı ezdiği için !important şart */
    .gf-topbar form { order: 3; flex: 1 0 100% !important; max-width: none !important; }
    .gf-topbar nav { margin-left: auto; gap: 6px; }
    .gf-topbar nav .btn { padding: .38rem .7rem; font-size: .78rem; }

    /* Şerit ve kartlar yatay kaydırılsın, sıkışıp okunmaz olmasın */
    .gf-cards { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
    .gf-cards > * { scroll-snap-align: start; }
    .gf-card { min-width: 172px; }

    /* minmax(0,1fr): düz "1fr" min-width:auto demek ve sütun içeriğin altına
       inemiyor; piyasa kartları sütunu 1200 px'e şişirip tüm sayfayı taşırıyordu. */
    .gf-layout, .gf-layout-2 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .gf-layout > *, .gf-layout-2 > * { min-width: 0; }
    #ai-panel { height: 480px; }

    .gf-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gf-tab { padding: 9px 12px; font-size: .85rem; white-space: nowrap; }

    /* Piyasa özeti tek sütuna insin */
    .gf-layout main > div[style*="grid-template-columns:1fr 1fr"],
    .gf-layout main > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .gf-news-grid { grid-template-columns: 1fr; }
    .gf-table { font-size: .8rem; }
    .gf-table th, .gf-table td { padding: 7px 8px; }

    /* Detay sayfasındaki kontroller alt alta */
    form[style*="grid-template-columns:1fr 1fr 2fr"],
    form[style*="grid-template-columns: 1fr 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }

    .gf-modal { padding: 16px; border-radius: 12px; max-height: 92vh; }
    .gf-modal-bg { padding: 10px; }

    /* Takvim: gün kutuları küçülsün ama okunur kalsın */
    .gf-cal-cell { min-height: 56px; padding: 6px 7px; border-radius: 8px; }
    .gf-cal-day { font-size: .82rem; }
    .gf-cal-count, .gf-cal-note { font-size: .6rem; }
    .gf-cal-row { gap: 4px; }
    .gf-cal-head { gap: 18px; flex-wrap: wrap; }

    .gf-toast { left: 14px; right: 14px; transform: none; text-align: center; border-radius: 14px; }
    .gf-toast.show { transform: none; }
}

@media (max-width: 420px) {
    .gf-cal-note { display: none; }      /* dar ekranda gün numarası yeter */
    .gf-topbar nav .btn { padding: .34rem .6rem; font-size: .72rem; }
}
