:root {
  --bg: #f6f5f2; --bg2: #ffffff; --bg3: #efede8; --line: #e3e0d9; --text: #17171a; --muted: #6d6b66;
  --accent: #d62839; --accent-soft: #fbe3e5; --ai: #6d4aff; --ai-soft: #eee9ff;
  --up: #12895a; --down: #d02f3c; --live: #e3262f; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 18px rgba(0,0,0,.05);
  --radius: 14px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Georgia", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --bg2: #1a1b1e; --bg3: #232428; --line: #2c2d31; --text: #ececee; --muted: #9a9aa1;
    --accent: #ff4d5e; --accent-soft: #3a1d21; --ai: #a58bff; --ai-soft: #262040; --up: #2fcf8a; --down: #ff6170;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --bg2: #1a1b1e; --bg3: #232428; --line: #2c2d31; --text: #ececee; --muted: #9a9aa1;
  --accent: #ff4d5e; --accent-soft: #3a1d21; --ai: #a58bff; --ai-soft: #262040; --up: #2fcf8a; --down: #ff6170;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Üst bar ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; max-width: 1320px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-weight: 700; font-size: 23px; letter-spacing: -.3px; }
.brand.big { font-size: 34px; justify-content: center; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-family: var(--serif); font-size: 19px; }
.brand.big .logo-mark { width: 44px; height: 44px; font-size: 28px; border-radius: 12px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; }
.icon-btn:hover { background: var(--bg3); }
.pill-btn { border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 7px 13px; font-weight: 600; font-size: 14px; }
.pill-btn.ai { border-color: transparent; background: var(--ai-soft); color: var(--ai); }
@media (max-width: 420px) { .pill-btn.ai span { display: none; } }

/* ── Piyasa şeridi ── */
.ticker { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 8px; scrollbar-width: none; max-width: 1320px; margin: 0 auto; }
.ticker::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.tk { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.tk b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tk .n { color: var(--muted); font-size: 12px; }
.tk .c { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.tk svg.spark { width: 42px; height: 16px; stroke-width: 1.5; }

/* ── Sekmeler ── */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; max-width: 1320px; margin: 0 auto; }
.tab { flex: 0 0 auto; border: 0; background: transparent; padding: 9px 11px 11px; font-weight: 600; font-size: 14.5px; color: var(--muted); border-bottom: 2.5px solid transparent; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-left: 5px; vertical-align: 2px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ── Düzen ── */
.layout { max-width: 1320px; margin: 0 auto; padding: 14px 16px 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.side { display: none; }
@media (min-width: 1100px) { .side { display: block; position: sticky; top: 140px; align-self: start; max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.section-title h2 { margin: 0; font-family: var(--serif); font-size: 22px; letter-spacing: -.2px; }
.section-title .muted { font-size: 13px; }

/* ── Haber kartları ── */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .card.hero { grid-column: 1 / -1; } }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: transform .12s ease, border-color .12s; min-width: 0; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.card:active { transform: scale(.995); }
.card-top { display: flex; gap: 12px; }
.card-text { flex: 1; min-width: 0; }
.card h3 { margin: 0; font-size: 16.5px; line-height: 1.3; font-weight: 700; letter-spacing: -.1px; }
.card.hero h3 { font-family: var(--serif); font-size: 25px; line-height: 1.2; }
.card p.sum { margin: 6px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.hero p.sum { -webkit-line-clamp: 3; font-size: 15px; }
.thumb { flex: 0 0 auto; width: 92px; height: 92px; border-radius: 10px; object-fit: cover; background: var(--bg3); }
.card.hero .card-top { flex-direction: column-reverse; }
.card.hero .thumb { width: 100%; height: auto; aspect-ratio: 16/7; max-height: 340px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--bg3); font-size: 12px; font-weight: 600; color: var(--muted); }
.chip.hot { background: var(--accent-soft); color: var(--accent); }
.chip.ai { background: var(--ai-soft); color: var(--ai); }
.chip.live { background: var(--live); color: #fff; }
.favs { display: flex; align-items: center; }
.favs img { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bg2); background: var(--bg3); margin-left: -6px; object-fit: cover; }
.favs img:first-child { margin-left: 0; }
.favs .more { margin-left: 6px; font-size: 12px; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-btn { border: 0; background: var(--ai-soft); color: var(--ai); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ai-btn:disabled { opacity: .6; }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.more-btn { display: block; margin: 16px auto; }
.btn { border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ai { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* liste (son dakika) */
.list { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.li { display: flex; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); align-items: flex-start; }
.li:first-child { border-top: 0; }
.li img.fav { width: 18px; height: 18px; border-radius: 4px; margin-top: 2px; }
.li .t { font-weight: 600; font-size: 14.5px; }
.li .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.li .orig { font-size: 12.5px; color: var(--muted); font-style: italic; }
.li .time { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; }

/* ── Yan sütun ── */
.box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.box h4 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.box h4 a { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.ask-box { display: flex; gap: 6px; }
.ask-box input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 10px; }

/* ── Ekşi ── */
.ek { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.ek:first-child { border-top: 0; }
.ek .r { width: 22px; text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ek .tt { flex: 1; min-width: 0; font-size: 14.5px; }
.ek .cnt { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ek .d { font-size: 11.5px; font-weight: 700; color: var(--up); min-width: 34px; text-align: right; }
.side .ek { padding: 7px 0; }
.entry { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.entry .em { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Maçlar ── */
.datebar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.datebar button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 6px 11px; font-size: 13px; font-weight: 600; }
.datebar button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.datebar input[type=date] { border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 5px 8px; }
.league { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.league-h { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: var(--bg3); font-weight: 700; font-size: 13.5px; }
.league-h button { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.match { display: grid; grid-template-columns: 46px minmax(0, 1fr) 50px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.match:first-of-type { border-top: 0; }
.match .st { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.match .st.live { color: var(--live); }
.match .tm { display: flex; align-items: center; gap: 7px; min-width: 0; }
.match .tm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .tm.h { justify-content: flex-end; text-align: right; }
.match .tm img { width: 20px; height: 20px; object-fit: contain; flex: 0 0 auto; }
.match .sc { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--bg3); border-radius: 7px; padding: 3px 0; }
.match .sc.live { background: var(--live); color: #fff; }
.match.fav { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.match .w { font-weight: 700; }
.ev { display: flex; gap: 8px; font-size: 13.5px; padding: 5px 0; border-top: 1px dashed var(--line); }
.ev .mn { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev.away { flex-direction: row-reverse; text-align: right; }
.stat { display: grid; grid-template-columns: 50px 1fr 50px; text-align: center; font-size: 13.5px; padding: 5px 0; border-top: 1px solid var(--line); }
table.std { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.std th, table.std td { padding: 6px 4px; text-align: center; border-top: 1px solid var(--line); }
table.std th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.std td.tn { text-align: left; display: flex; align-items: center; gap: 6px; }
table.std td.tn img { width: 18px; height: 18px; object-fit: contain; }
table.std td.rk { border-left: 3px solid transparent; }
.star { border: 0; background: transparent; font-size: 17px; line-height: 1; padding: 2px 4px; color: var(--muted); }
.star.on { color: #f2b705; }

/* ── Alt sayfa (sheet) ── */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.42); animation: fade .15s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; background: var(--bg); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .2s ease; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 900px) { .sheet-panel { left: auto; top: 0; bottom: 0; width: 640px; max-height: none; border-radius: 0; animation: slide .2s ease; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; justify-content: flex-end; align-items: center; padding: 6px 8px 0; position: relative; }
.sheet-grip { position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; border-radius: 4px; background: var(--line); transform: translateX(-50%); }
@media (min-width: 900px) { .sheet-grip { display: none; } }
.sheet-body { overflow-y: auto; padding: 0 18px 30px; -webkit-overflow-scrolling: touch; }
.sheet-body h2 { font-family: var(--serif); font-size: 24px; line-height: 1.22; margin: 4px 0 10px; }
.sheet-body .hero-img { width: 100%; border-radius: 12px; aspect-ratio: 16/7; max-height: 300px; object-fit: cover; background: var(--bg3); margin-bottom: 10px; }
.src { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.src img { width: 20px; height: 20px; border-radius: 5px; margin-top: 2px; }
.src .n { font-size: 12.5px; color: var(--muted); }
.src .t { font-weight: 600; font-size: 14.5px; }
.grp-h { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin: 16px 0 2px; }

/* ── Yapay zekâ metni ── */
.ai-box { background: var(--ai-soft); border-radius: 14px; padding: 4px 16px 12px; margin: 10px 0 14px; position: relative; }
.ai-box .ai-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--ai); padding-top: 10px; font-weight: 600; }
.md { font-size: 15px; line-height: 1.55; }
.md h1 { font-family: var(--serif); font-size: 24px; margin: 14px 0 6px; }
.md h2 { font-size: 16.5px; margin: 16px 0 6px; }
.md h3 { font-size: 15px; margin: 12px 0 4px; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0; }
.md li { margin: 4px 0; }
.md p { margin: 6px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 8px 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; }
.md .src-tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, var(--bg2) 70%, transparent); color: var(--muted); white-space: nowrap; }
.md .k-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 6px; background: var(--ai); color: #fff; cursor: pointer; }
.md a { color: var(--ai); text-decoration: underline; }
.cursor::after { content: "▍"; animation: pulse 1s infinite; color: var(--ai); }
.notice { background: var(--bg3); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0; }

/* ── Arama ── */
.search-in { display: flex; gap: 8px; position: sticky; top: 0; background: var(--bg); padding: 6px 0 10px; z-index: 2; }
.search-in input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 11px 13px; font-size: 16px; }

/* ── Ayarlar ── */
.set h3 { margin: 22px 0 8px; font-size: 16px; }
.set label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.set input[type=text], .set input[type=password], .set select { width: 100%; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 9px 11px; }
.pubrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.pubrow img { width: 18px; height: 18px; border-radius: 4px; }
.pubrow .nm { flex: 1; min-width: 0; }
.pubrow .nm small { display: block; color: var(--muted); font-size: 12px; }
.pubrow select { width: auto !important; padding: 4px 6px !important; font-size: 12.5px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 24px; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--up); }
.switch input:checked + span::before { transform: translateX(18px); }
.err { color: var(--down); font-size: 13px; min-height: 18px; }
.okc { color: var(--up); }

/* ── Giriş ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-box input { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 80; box-shadow: var(--shadow); }
.skel { background: linear-gradient(90deg, var(--bg3), var(--bg2), var(--bg3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Piyasa etkisi ── */
.impact { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.imp { padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; background: var(--bg3); color: var(--muted); white-space: nowrap; }
.imp.up { color: var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.imp.down { color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }
.ai-box.imp-box { background: var(--bg3); }
.ai-box.imp-box .ai-meta { color: var(--text); }
.disc { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
