:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec;
  --side: #14213d; --side-ink: #cfd6e6; --accent: #1f6f5c; --accent-soft: #e3f1ec;
  --warn: #b26b00; --warn-soft: #fff4e0; --bad: #b42318; --bad-soft: #fdecea; --info: #2457a6; --info-soft: #e8effb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.hidden { display: none !important; }
a { color: var(--info); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #14213d 0%, #1f6f5c 100%); }
.login-card { background: #fff; padding: 32px; border-radius: 14px; width: 340px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: grid; gap: 14px; }
.login-card .brand { color: var(--ink); font-size: 18px; }
.login-card label { display: grid; gap: 6px; font-weight: 500; }

/* layout */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 16px; color: #fff; padding: 4px 10px 18px; display: flex; gap: 8px; align-items: center; }
.logo { color: #4fd1a5; }
nav { display: grid; gap: 2px; }
nav a { color: var(--side-ink); text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
nav a span { width: 18px; text-align: center; opacity: .8; }
nav a:hover { background: rgba(255,255,255,.06); }
nav a.active { background: rgba(79,209,165,.16); color: #fff; }
nav .tag { font-style: normal; font-size: 10px; background: rgba(255,255,255,.12); padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 10px; }
main { padding: 0 28px 40px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 0 16px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.date-pick { display: flex; gap: 8px; align-items: center; color: var(--muted); }

/* components */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .side { position: static; height: auto; } .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; }
.btn:hover { border-color: #c7ccd6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.2); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: wait; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { width: 100%; min-height: 80px; }
label.f { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.f input, label.f select { color: var(--ink); font-size: 14px; }
.err { color: var(--bad); min-height: 18px; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--info-soft); color: #1b3f7a; font-size: 13px; }
.note.warn { background: var(--warn-soft); color: #7a4a00; }
.note.bad { background: var(--bad-soft); color: #8a1c12; }
.note.ok { background: var(--accent-soft); color: #145444; }
.note + .note { margin-top: 8px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #eef0f4; color: #4a5263; white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8fafc; }
tr.dim td { opacity: .45; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #eef0f4; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.mk > i { background: #9aa3b5; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* coupon legs */
.legs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.leg { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.leg.weak { border-color: #f0b44c; box-shadow: 0 0 0 2px #fff4e0 inset; }
.leg h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.horse { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-top: 1px dashed #eef0f4; font-size: 13px; }
.horse:first-of-type { border-top: 0; }
.horse .no { width: 24px; height: 24px; border-radius: 6px; background: #eef0f4; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.horse.sel .no { background: var(--accent); color: #fff; }
.horse.b .no { background: #c9dcf5; color: var(--info); }
.horse.veto { text-decoration: line-through; opacity: .5; }
.horse .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.horse .pp { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; width: 42px; text-align: right; }
.horse .acts { display: flex; gap: 2px; }
.horse .acts button { border: 1px solid var(--line); background: #fff; border-radius: 5px; font-size: 11px; padding: 1px 5px; cursor: pointer; }
.horse .acts button:hover { background: #f4f5f7; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: start center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal-card { background: #fff; border-radius: 12px; max-width: 1100px; width: 100%; padding: 22px 24px; position: relative; }
.modal-x { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 20px; right: 20px; background: #1d2433; color: #fff; padding: 12px 16px; border-radius: 10px; max-width: 460px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.25); white-space: pre-wrap; }
.toast.bad { background: var(--bad); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #c7ccd6; border-top-color: var(--accent); border-radius: 50%; animation: s .8s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
.chart text { font-size: 10px; fill: var(--muted); }
pre.json { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; max-height: 420px; overflow: auto; font-size: 12px; }
.md h1, .md h2, .md h3 { margin: 12px 0 6px; } .md p { margin: 6px 0; } .md ul { margin: 4px 0; padding-left: 20px; }

/* günün tahminleri */
.hip-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.hip-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 22px; padding: 7px 14px; cursor: pointer; font: inherit; }
.hip-tabs button.active { background: var(--side); color: #fff; border-color: var(--side); }
.hip-tabs button small { opacity: .7; margin-left: 4px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; }
.section-title h2 { margin: 0; font-size: 17px; }
.kupon-line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f4f5f7; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; word-break: break-word; }
.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.race-grid > .card + .card { margin-top: 0; }
.race-card h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.race-card .meta { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 4px 6px; border-bottom: 1px solid #f0f1f4; }
.mini tr:last-child td { border-bottom: 0; }
.mini td.k { font-weight: 700; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mini { table-layout: fixed; }
.mini td.nm { color: var(--muted); font-size: 11px; line-height: 1.25; overflow: hidden; }
.mini td.nm div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two .mini td.k { width: 44px; } .two .mini td.pp { width: 46px; }
.mini td.pp { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini tr.best td { background: var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.horse .ag { font-size: 11px; color: var(--muted); width: 46px; text-align: right; }
.empty { text-align: center; padding: 28px; color: var(--muted); }

/* sade görünüm */
.nav-group { margin: 18px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: rgba(207,214,230,.5); }
nav a.sub { font-size: 13px; padding: 7px 10px; color: rgba(207,214,230,.8); }
.hip { padding: 0; overflow: hidden; }
.hip-head { padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; border-bottom: 1px solid var(--line); background: #fafbfc; }
.hip-head h2 { margin: 0; font-size: 18px; }
.hip-head .cond { color: var(--muted); font-size: 13px; }
.alt-btn { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 22px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.alt-btn:hover { background: var(--accent-soft); }
.alt-btn.done { border-color: var(--line); color: var(--muted); font-weight: 500; }
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { display: grid; grid-template-columns: 44px 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #f0f1f4; cursor: pointer; }
.rlist li:last-child { border-bottom: 0; }
.rlist li:hover { background: #f7f9fb; }
.rlist .num { width: 34px; height: 34px; border-radius: 50%; background: var(--side); color: #fff; display: grid; place-items: center; font-weight: 700; }
.rlist li.done .num { background: #c7ccd6; }
.rlist .time { font-weight: 600; font-variant-numeric: tabular-nums; }
.rlist .title { font-weight: 600; }
.rlist .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rlist .right { text-align: right; font-size: 13px; }
.rlist .go { color: var(--accent); font-weight: 600; }
@media (max-width: 700px) { .rlist li { grid-template-columns: 40px 1fr; } .rlist .time { display: none; } .rlist .right { grid-column: 2; text-align: left; } }
.verdict { font-size: 17px; font-weight: 600; margin: 6px 0 16px; }
.cands { display: grid; gap: 10px; }
.cand { display: grid; grid-template-columns: 48px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cand .big { width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.cand:not(:first-child) .big { background: #4b5b78; }
.cand .nm { font-weight: 700; font-size: 15px; }
.cand .ch { font-size: 13px; margin: 2px 0 6px; }
.cand ul { margin: 0; padding-left: 0; list-style: none; font-size: 13px; display: grid; gap: 2px; }
.cand li.neg { color: var(--warn); }
.combo-box { border: 2px solid var(--accent); border-radius: 12px; padding: 14px 16px; background: var(--accent-soft); }
.combos { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.combo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 800; background: #fff; border: 1px solid #b9dccf; border-radius: 10px; padding: 6px 12px; }
.combo small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); font-family: inherit; text-align: center; }
.result-box { border-radius: 12px; padding: 12px 16px; background: #f4f5f7; margin-bottom: 16px; }
.bud { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bud button { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; cursor: pointer; font: inherit; }
.bud button.active { background: var(--side); color: #fff; border-color: var(--side); }
.ayak-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f1f4; }
.ayak-row .ah { font-weight: 700; }
.ayak-row .nos { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 800; }
.ayak-row .why { font-size: 13px; color: var(--muted); }
details.more summary { cursor: pointer; color: var(--info); margin-top: 14px; }
