/* TEFAS Quant - stil sayfası.
   Portföy Analiz ile aynı tasarım dili: CSS değişkenleri, açık/koyu tema,
   sol menü + üst bar. Kurumsal lacivert (--brand) başlık bantlarında kullanılır. */

:root {
  --bg:            #f3f6fb;
  --surface:       #ffffff;
  --surface-2:     #eef3f9;
  --border:        #dfe7f1;
  --text:          #12233d;
  --text-dim:      #6b7b91;
  --accent:        #1f5fbf;
  --accent-soft:   #e7f0ff;
  --brand:         #0b2a5b;
  --brand-2:       #123f86;
  --brand-3:       #1f5fbf;
  --up:            #0f9d58;
  --up-soft:       #e3f5ec;
  --down:          #e5484d;
  --down-soft:     #fdeaea;
  --warn:          #b7791f;
  --warn-soft:     #fdf3e1;
  --shadow:        0 1px 2px rgba(20,40,70,.035), 0 7px 22px rgba(20,40,70,.045);
  --radius:        12px;
  --radius-sm:     9px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --c1: #2563eb; --c2: #ea580c; --c3: #be123c; --c4: #15803d; --c5: #7c3aed; --c6: #0891b2; --c7: #ca8a04;

  /* Not renkleri: A+ koyu yeşil ... D kırmızı */
  --g-aplus: #0b7a45; --g-a: #34a26b; --g-b: #c58b12; --g-c: #e0742b; --g-d: #d43d43;
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #101827; --surface-2: #172235; --border: #1e2d43;
    --text: #dce7f5; --text-dim: #8a9bb2; --accent: #4b8df8; --accent-soft: #172a47;
    --up: #3fb950; --up-soft: #10261a; --down: #f85149; --down-soft: #2c1618;
    --warn: #d9a441; --warn-soft: #2b2212;
    --shadow: 0 1px 2px rgba(0,0,0,.16), 0 8px 24px rgba(0,0,0,.12);
  }
}
html[data-theme="dark"] {
  --bg: #0b1120; --surface: #101827; --surface-2: #172235; --border: #1e2d43;
  --text: #dce7f5; --text-dim: #8a9bb2; --accent: #4b8df8; --accent-soft: #172a47;
  --up: #3fb950; --up-soft: #10261a; --down: #f85149; --down-soft: #2c1618;
  --warn: #d9a441; --warn-soft: #2b2212;
  --shadow: 0 1px 2px rgba(0,0,0,.16), 0 8px 24px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
a { color: var(--accent); text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------- kabuk */

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; z-index: 45; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border-right: 1px solid var(--border); padding: 0 12px;
}
.sidebar-brand {
  min-height: 72px; display: flex; align-items: center; gap: 11px;
  padding: 0 8px; border-bottom: 1px solid var(--border); color: var(--text);
}
.brand-mark { display: block; width: 38px; height: 38px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.brand-copy { display: grid; }
.brand-text { font-size: 1rem; font-weight: 750; letter-spacing: -.025em; }
.brand-caption, .page-eyebrow, .hero-eyebrow {
  color: var(--text-dim); font-family: var(--mono); font-size: .58rem; font-weight: 650; letter-spacing: .13em;
}
.sidebar-nav { display: flex; flex-direction: column; flex: 1; gap: 14px; overflow-y: auto; padding: 18px 0 12px; }
.nav-section { display: grid; gap: 3px; }
.nav-heading { padding: 0 11px 5px; color: var(--text-dim); opacity: .68; font-family: var(--mono); font-size: .59rem; font-weight: 700; letter-spacing: .12em; }
.tab {
  display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 10px;
  border-left: 2px solid transparent; border-radius: 7px; color: var(--text-dim);
  font-size: .87rem; font-weight: 560; transition: background .16s, color .16s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); }
.nav-icon { display: inline-grid; place-items: center; flex: 0 0 20px; font-size: 1rem; line-height: 1; }
.sidebar-status { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px; border-top: 1px solid var(--border); color: var(--text-dim); font-family: var(--mono); font-size: .65rem; letter-spacing: .04em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 15%, transparent); }
.main-column { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border);
}
.topbar-inner {
  width: 100%; max-width: 1480px; min-height: 72px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 28px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.page-heading { display: grid; gap: 1px; min-width: 0; }
.page-heading h1 { font-size: 1.14rem; font-weight: 680; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-logo, .topbar-brand { display: none; }
.topbar-logo img { display: block; width: 34px; height: 34px; border-radius: 9px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.topbar-brand { font-size: .95rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; }

select, input[type="text"], input[type="search"] {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; min-height: 36px; outline: none;
}
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

.ac-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; min-width: 300px;
  max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.ac-item { padding: 8px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; color: var(--text); }
.ac-item:hover { background: var(--accent-soft); }
.ac-item .ac-name { color: var(--text-dim); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete { position: relative; display: inline-block; }

/* ------------------------------------------------------------ yerleşim */

.app { width: 100%; max-width: 1480px; margin: 0 auto; padding: 26px 28px 44px; display: grid; gap: 16px; }
.app > *, .grid > * { min-width: 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .sub, .section-head .sub { color: var(--text-dim); font-size: .82rem; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 2px 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-leaders { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.up { color: var(--up); }
.down { color: var(--down); }
.dim { color: var(--text-dim); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- kurumsal bant */

.hero, .fund-hero, .method-intro.card {
  position: relative; overflow: hidden; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  box-shadow: var(--shadow);
}
.hero::after, .fund-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 240px at 92% -20%, rgba(255,255,255,.14), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 1px, transparent 1px 22px);
}
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; padding: 30px 32px; }
.hero > *, .fund-hero > * { position: relative; z-index: 1; }
.hero-eyebrow { color: rgba(255,255,255,.72); }
.hero h2 { font-size: 1.55rem; line-height: 1.25; margin: 10px 0 10px; letter-spacing: -.02em; max-width: 640px; }
.hero p { margin: 0; color: rgba(255,255,255,.82); max-width: 620px; font-size: .92rem; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
.hero-figures > div, .fund-hero-figs > div {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
  padding: 12px 14px; display: grid; gap: 4px;
}
.hero-figures span, .fund-hero-figs span { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.75); }
.hero-figures strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.method-intro.card { border: 0; padding: 26px 30px; }
.method-intro h2 { font-size: 1.3rem; margin-bottom: 8px; }
.model-tag { font-size: .72rem; font-weight: 700; letter-spacing: .06em; vertical-align: middle; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); margin-left: 8px; white-space: nowrap; display: inline-block; }
.method-intro p { color: rgba(255,255,255,.85); max-width: 900px; margin: 0 0 12px; }
.steps { margin: 0; padding-left: 20px; color: rgba(255,255,255,.9); display: grid; gap: 4px; max-width: 980px; }

/* ----------------------------------------------------------- butonlar */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; min-height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 560; font-size: .9rem;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-light { background: #fff; color: var(--brand); border-color: #fff; }
.btn-light:hover { background: #eef3fb; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
/* Mavi bilgi kartı içindeki sekme düğmeleri: beyaz zemin, siyah yazı; seçili olan koyu çerçeveli */
.btn.hero-tab { background: #fff; color: #12233d; border-color: #fff; min-width: 110px; justify-content: center; }
.btn.hero-tab:hover { background: #eef3fb; }
.btn.hero-tab[aria-pressed="true"] { font-weight: 800; box-shadow: 0 0 0 3px rgba(255,255,255,.55); }
.btn.hero-tab[aria-pressed="false"] { font-weight: 600; }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: .84rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--text-dim); padding: 5px 12px; cursor: pointer; font-size: .84rem; font-weight: 560; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .86rem; color: var(--text-dim); user-select: none; }
.switch { position: relative; }
#app .switch input, .switch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-width: 0; }
.switch-ui { width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .16s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .16s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar { display: flex; justify-content: flex-end; }

/* -------------------------------------------------------- notlar/rozetler */

.grade {
  display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px;
  border-radius: 6px; font-weight: 750; font-size: .78rem; color: #fff; letter-spacing: .02em;
  background: var(--g, var(--text-dim));
}
.signal { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  color: var(--g); background: color-mix(in srgb, var(--g) 13%, transparent); }
.sig-aplus { --g: var(--g-aplus); }
.sig-a { --g: var(--g-a); }
.sig-b { --g: var(--g-b); }
.sig-c { --g: var(--g-c); }
.sig-d { --g: var(--g-d); }
.fund-hero .signal { background: rgba(255,255,255,.92); }

.pill { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--text-dim); }
.pill.down { background: var(--down-soft); color: var(--down); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.tag-warn { background: rgba(255,196,87,.18); border-color: rgba(255,196,87,.45); }
.tag-danger { background: rgba(229,72,77,.28); border-color: rgba(255,140,140,.6); }

.code-chip {
  font-family: var(--mono); font-weight: 700; font-size: .8rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px;
}
a.code-chip:hover { border-color: var(--accent); color: var(--accent); }

.scorebar { display: inline-block; width: 64px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.scorebar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-3), var(--accent)); }
.score-cell { white-space: nowrap; }

/* ------------------------------------------------------------ dağılım */

.dist-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; }
.dist-bar span { background: var(--g); min-width: 3px; }
.dist-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 14px; }
.dist-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: .86rem; }
.dist-item:hover { background: var(--accent-soft); }
.dist-item b { margin-left: auto; }

/* -------------------------------------------------------------- liderler */

.leader { display: grid; gap: 4px; color: var(--text); transition: border-color .16s, transform .16s; border-top: 3px solid var(--brand-3); }
.leader:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-1px); }
.leader-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.leader-cat { color: var(--text-dim); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.leader-code { font-family: var(--mono); font-size: 1.35rem; font-weight: 750; color: var(--brand-3); margin-top: 4px; }
html[data-theme="dark"] .leader-code { color: var(--accent); }
.leader-name { color: var(--text-dim); font-size: .8rem; line-height: 1.35; height: 2.7em; overflow: hidden; }
.leader-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.leader-figs span { display: block; font-size: .66rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.leader-figs b { font-variant-numeric: tabular-nums; font-size: .95rem; }

/* -------------------------------------------------------------- tablolar */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: 9px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th.left, td.left { text-align: left; }
th {
  color: var(--text-dim); font-weight: 650; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
tbody tr { border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
tbody tr:hover { background: var(--surface-2); }
tbody td { font-variant-numeric: tabular-nums; }
tr.row-link { cursor: pointer; }
tr.is-self { background: var(--accent-soft); }
.fund-cell { text-align: left; max-width: 380px; }
.fund-cell .name { margin-left: 8px; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 300px; vertical-align: bottom; }
.cat-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
table.ranking th, table.ranking td { padding-left: 7px; padding-right: 7px; }
table.ranking .fund-cell .name { max-width: 190px; }
table.ranking .scorebar { width: 44px; }
@media (max-width: 1500px) { table.ranking .cat-cell, table.ranking th[data-key="k"] { display: none; } }
table.compact td, table.compact th { padding: 7px 8px; }
td.pick, th.pick { width: 28px; padding-right: 0; }
td.pick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
td.empty { text-align: center; padding: 30px; color: var(--text-dim); }

table.kv td { padding: 7px 0; }
table.kv td:last-child { text-align: right; font-weight: 600; }
table.kv tr:last-child { border-bottom: 0; }
table.rules th { text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--text); padding: 12px 0 4px; background: none; position: static; }
table.rules td { white-space: normal; }

table.waterfall td { padding: 8px 6px; }
table.waterfall td:first-child { white-space: normal; }
table.waterfall tr.subtotal td { font-weight: 700; border-top: 1px solid var(--border); background: var(--surface-2); }
table.waterfall tr.total td { font-weight: 800; font-size: 1rem; border-top: 2px solid var(--brand-3); color: var(--brand-3); }
html[data-theme="dark"] table.waterfall tr.total td { color: var(--accent); }
table.waterfall tr.muted td { color: var(--text-dim); }

table.compare th { vertical-align: bottom; text-align: right; }
table.compare .th-name { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .74rem; white-space: normal; max-width: 200px; margin-left: auto; color: var(--text-dim); }
table.compare tr.group td { background: var(--surface-2); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
table.compare td.best { background: var(--up-soft); font-weight: 700; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pagination-controls { display: flex; gap: 8px; }

/* -------------------------------------------------------------- filtreler */

.filter-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.2fr auto; gap: 12px; align-items: end; }
.field { display: grid; gap: 5px; }
.field > span { font-size: .76rem; color: var(--text-dim); font-weight: 600; }
.field input, .field select { width: 100%; }
.field-end { align-self: center; padding-bottom: 6px; }

.picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: .85rem; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }

/* ------------------------------------------------------------- fon detay */

.fund-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 26px 30px; align-items: center; }
.fund-hero h2 { font-size: 1.35rem; margin: 10px 0 16px; line-height: 1.3; }
.fund-hero h2 .mono { background: rgba(255,255,255,.14); padding: 2px 9px; border-radius: 8px; margin-right: 6px; }
.fund-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fund-hero-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.fund-hero-figs b { font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.fund-hero-score { display: grid; justify-items: center; gap: 10px; }
.ring { width: 148px; height: 148px; }
.ring-bg { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 11; }
.ring-fg { fill: none; stroke: #fff; stroke-width: 11; stroke-linecap: round; }
.ring-val { fill: #fff; font-size: 30px; font-weight: 800; font-family: var(--sans); }
.ring-cap { fill: rgba(255,255,255,.7); font-size: 12px; font-family: var(--sans); }
.fund-grade { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; }
.fund-grade .grade { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }

.notice { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 13px; font-size: .86rem; color: var(--text); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice.danger { border-left-color: var(--down); background: var(--down-soft); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 18px; font-size: .88rem; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 800; flex: none; }
.checklist li.ok span { background: var(--up-soft); color: var(--up); }
.checklist li.no { color: var(--text-dim); }
.checklist li.no span { background: var(--down-soft); color: var(--down); }
.mini-flag { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 5px; border-radius: 50%; background: var(--down); color: #fff; font-size: .62rem; font-weight: 800; vertical-align: middle; }
.notice-card.warn { border-left: 4px solid var(--warn); }
.notice-card p { margin: 6px 0 0; }

/* ------------------------------------------------------------- grafikler */

.chart { width: 100%; position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: hidden; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .base-line { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; }
.chart .axis { fill: var(--text-dim); font-size: 11px; font-family: var(--sans); }
.chart .hover-line { stroke: var(--text-dim); stroke-width: 1; opacity: .5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: .82rem; color: var(--text-dim); }
.chart-legend .item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none;
  color: inherit; font: inherit; padding: 2px 8px; border-radius: 999px; cursor: pointer; transition: opacity .15s, background .15s; }
.chart-legend .item:hover { background: var(--surface-2); border-color: var(--border); }
.chart-legend .item.off { opacity: .4; text-decoration: line-through; }
.chart-legend .item.off .swatch { background: var(--border) !important; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-note { font-size: .76rem; margin: 6px 0 0; }
.period-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; margin-top: 10px; }
.period-compare > div { background: var(--surface-2); border-radius: 8px; padding: 7px 9px; display: grid; gap: 2px; }
.period-compare span { font-size: .68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.period-compare b { font-variant-numeric: tabular-nums; font-size: .95rem; }
.period-compare .pc-strong { background: var(--accent-soft); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px 10px; font-size: .8rem; min-width: 140px;
  transform: translateX(-50%); font-variant-numeric: tabular-nums;
}
.tooltip .t-date { color: var(--text-dim); font-size: .74rem; margin-bottom: 4px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 12px; }
.tooltip .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ------------------------------------------------------------- model */
.weight-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin: 2px 0 14px; gap: 2px; }
.weight-bar span { display: flex; align-items: center; justify-content: center; min-width: 4px; color: #fff; font-size: .74rem; font-weight: 700; white-space: nowrap; overflow: hidden; }
@media (max-width: 640px) { table.model-table td .fund-name { max-width: 150px; } }
.mdl-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: middle; }
.model-table td .fund-name, .compact .fund-name { display: block; font-size: .76rem; color: var(--text-dim); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.model-table .weight { font-size: 1rem; }
.model-table tfoot td { border-top: 1px solid var(--border); }
.hold-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border: 1px solid var(--border); border-radius: 999px; font-size: .84rem; }
.rule-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: .9rem; line-height: 1.5; }
.ch-tag, .ax-tag, .fx-tag { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 4px; white-space: nowrap; }
.ch-tag { background: var(--accent-soft); color: var(--accent); }
.ax-tag { background: var(--warn-soft); color: var(--warn); }
.fx-tag { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.seg-lg { margin: 4px 0; }
.seg-lg button { padding: 8px 20px; font-size: .92rem; }
button.dist-item { font: inherit; background: none; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; color: inherit; }
button.dist-item[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sub-head { margin-top: 16px; }
.sub-head h3 { font-size: .98rem; }
.calc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
p.small, .small { font-size: .8rem; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
tr.group-row td { background: var(--surface-2); font-size: .82rem; padding-top: 8px; }
.danger-tag { background: var(--down-soft); color: var(--down); }
.cmp-row.out-scope { opacity: .45; }
.sys-comment { margin-top: 14px; display: grid; gap: 8px; }
.sys-comment h3 { font-size: 1rem; }
.sys-comment ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.notice.good { border-left-color: var(--up); }
.cmp-rows { display: grid; gap: 6px; margin: 8px 0; }
.cmp-row { display: grid; grid-template-columns: 110px 80px 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cmp-row input { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.cmp-code { text-transform: uppercase; font-weight: 700; }
.cmp-name { font-size: .84rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-actions { align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.field.inline { display: inline-flex; align-items: center; gap: 6px; }
.glossary-title { margin: 18px 0 8px; font-size: .95rem; }
.glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.glossary > div { padding: 8px 0; border-top: 1px solid var(--border); }
.glossary dt { font-weight: 700; font-size: .86rem; }
.glossary dd { margin: 2px 0 0; font-size: .84rem; color: var(--text-dim); line-height: 1.45; }
@media (max-width: 640px) { .glossary { grid-template-columns: 1fr; } }
.profile-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-card { text-align: left; display: grid; gap: 3px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; border-top: 4px solid var(--pc, var(--brand-3)); font: inherit; }
.profile-card[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--pc, var(--brand-3)); background: var(--surface-2); }
.profile-card.tone-safe { --pc: #0f766e; }
.profile-card.tone-mid { --pc: #2563eb; }
.profile-card.tone-risk { --pc: #c2410c; }
.pc-label { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pc); }
.pc-main { font-size: 1.5rem; font-weight: 760; letter-spacing: -.02em; }
.pc-sub { font-size: .78rem; color: var(--text-dim); }
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 10px 0 14px; }
.kpi-row > div { display: grid; gap: 2px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.kpi-row span { font-size: .72rem; color: var(--text-dim); }
.kpi-row b { font-size: 1.05rem; }
.bank-tag, .leg-tag, .warn-tag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .05em; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.bank-tag { background: var(--accent-soft); color: var(--accent); }
.leg-tag { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.warn-tag { background: var(--warn-soft); color: var(--warn); letter-spacing: 0; font-size: .74rem; font-weight: 650; margin: 0; }
@media (max-width: 640px) {
  .profile-cards { grid-template-columns: 1fr; gap: 8px; }
  .profile-card { grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; padding: 10px 12px; }
  .pc-label { grid-column: 1 / -1; }
  .pc-sub { grid-column: 1 / -1; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------- metodoloji */

.weights { display: grid; gap: 9px; margin-bottom: 14px; }
.weight-row { display: grid; grid-template-columns: 140px 1fr 44px; gap: 10px; align-items: center; font-size: .88rem; }
.weight-row .scorebar { width: 100%; height: 8px; margin: 0; }
.weight-row b { text-align: right; font-variant-numeric: tabular-nums; }
.defs { margin: 0; display: grid; gap: 4px; font-size: .86rem; }
.defs dt { font-weight: 700; margin-top: 8px; }
.defs dd { margin: 0; color: var(--text-dim); }
ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .88rem; }

/* ------------------------------------------------------------ backtest */

.bt-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1350px) { .bt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bt-main { font-size: 1.35rem; } }
.bt-kpi { display: grid; gap: 4px; border-top: 3px solid var(--brand-3); }
.bt-kpi.muted { border-top-color: var(--border); }
.bt-h { color: var(--text-dim); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.bt-main { font-size: 1.7rem; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bt-sub { color: var(--text-dim); font-size: .8rem; }
.bt-na { font-size: 1.1rem; font-weight: 700; color: var(--text-dim); margin-top: 6px; }
.bt-rows { display: grid; gap: 5px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: .82rem; }
.bt-rows > div { display: flex; justify-content: space-between; gap: 8px; }
.bt-rows span { color: var(--text-dim); }
.bt-rows b { font-variant-numeric: tabular-nums; }
.small-note { font-size: .74rem; }
table.bt-grades td { white-space: nowrap; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline span { white-space: nowrap; }
.muted-chip { opacity: .55; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
#catChart { margin-bottom: 10px; }

/* ------------------------------------------------------------- durumlar */

.empty { text-align: center; padding: 36px 20px; color: var(--text-dim); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.loading { display: grid; place-items: center; gap: 14px; padding: 60px 20px; color: var(--text-dim); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 28px calc(34px + env(safe-area-inset-bottom)); color: var(--text-dim); font-size: .78rem; }
.footer p { margin: 4px 0; }
.disclaimer { max-width: 820px; }

/* ----------------------------------------------------------------- mobil */

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  /* Telefonda alt menü kalabalık olmasın: Metodoloji, Karşılaştır, BES, Değer, Model Raporu ve Portföy Simülasyonu
     yalnızca masaüstünde */
  .tab[data-view="metodoloji"], .tab[data-view="karsilastir"], .tab[data-view="bes"], .tab[data-view="deger"],
  .tab[data-view="modelrapor"], .tab[data-view="simulasyon"] { display: none; }
  /* Telefonda sol üstte sayfa etiketi yerine logo ve marka adı */
  .topbar-logo { display: block; flex: none; margin-right: -6px; }
  .topbar-brand { display: block; }
  .page-eyebrow { display: none; }
  .page-heading { flex: 1; }
  .page-heading h1 { font-size: .8rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-brand { white-space: nowrap; }
  /* Alt menü sayfa akışında en sonda durur ve ekranın altına yapışır (sticky). position: fixed iPhone ana ekran
     uygulamasında (özellikle tarih seçici / klavye kapandıktan sonra) kaydırırken ekranın ortasında kalabiliyordu. */
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .sidebar {
    position: sticky; top: auto; bottom: 0; order: 2; align-self: end; width: 100%; height: auto;
    padding: 0 8px env(safe-area-inset-bottom);
    border: 0; border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px);
  }
  .sidebar-brand, .sidebar-status, .nav-heading { display: none; }
  .sidebar-nav { flex-direction: row; gap: 0; overflow-x: auto; padding: 5px 0; }
  .nav-section { display: contents; }
  .tab { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 5px 4px; border: 0; font-size: .68rem; }
  .fund-hero { grid-template-columns: 1fr; }
  .fund-hero-score { grid-row: 1; justify-items: start; grid-auto-flow: column; align-items: center; }
  .ring { width: 108px; height: 108px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app { padding: 14px 12px 24px; gap: 12px; }
  .topbar-inner { min-height: 64px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .card { padding: 13px; }
  .hero { padding: 22px 18px; }
  .hero h2 { font-size: 1.2rem; }
  .hero-figures strong { font-size: 1.2rem; }
  .fund-hero { padding: 20px 18px; }
  .filter-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer { padding: 0 12px calc(20px + env(safe-area-inset-bottom)); }
  th, td { padding: 8px 7px; }
  .fund-cell .name { max-width: 160px; }
}

/* --------------------------------------------------------------- rapor (A4) */

.rp-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.rp-toolbar h2 { font-size: 1.1rem; }
.rp-toolbar p { margin: 2px 0 0; font-size: .84rem; }
.rp-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rp-doc { display: grid; gap: 22px; justify-items: center; }

/* Sayfa her zaman açık renkte (rapor kâğıdı), A4 oranında */
.rp-page {
  --rp-ink: #12233d; --rp-dim: #64748b; --rp-line: #e3e9f2; --rp-soft: #f3f6fb;
  --rp-up: #0f8a50; --rp-down: #d6404a; --rp-brand: #1f5fbf;
  width: 100%; max-width: 820px; aspect-ratio: 210 / 297; background: #fff; color: var(--rp-ink);
  border-radius: 6px; box-shadow: 0 10px 40px rgba(15, 35, 70, .16), 0 1px 3px rgba(15, 35, 70, .08);
  display: flex; flex-direction: column; overflow: hidden; font-size: 10.5px; line-height: 1.35;
}
.rp-page .up { color: var(--rp-up); }
.rp-page .down { color: var(--rp-down); }
.rp-cover {
  position: relative; padding: 22px 28px 18px; color: #fff;
  background: linear-gradient(120deg, #0b2a5b 0%, #123f86 58%, #1f5fbf 100%);
}
.rp-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 160px at 95% -30%, rgba(255,255,255,.18), transparent 60%),
              repeating-linear-gradient(115deg, rgba(255,255,255,.04) 0 1px, transparent 1px 18px); }
.rp-cover > * { position: relative; z-index: 1; }
.rp-brand { display: flex; align-items: center; gap: 9px; }
.rp-brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.rp-brand b { display: block; font-size: 13px; letter-spacing: -.01em; }
.rp-brand span { font-size: 7.5px; letter-spacing: .16em; opacity: .75; font-family: var(--mono); }
.rp-badge { position: absolute; top: 24px; right: 28px; font-size: 8.5px; font-weight: 800; letter-spacing: .12em;
  padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.32); }
.rp-cover h1 { margin: 16px 0 3px; font-size: 22px; letter-spacing: -.02em; font-weight: 750; }
.rp-period { margin: 0; font-size: 10.5px; opacity: .85; }

.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 28px 4px; }
.rp-kpis > div { background: var(--rp-soft); border-radius: 8px; padding: 9px 11px; border-left: 3px solid var(--rp-brand); display: grid; gap: 2px; }
.rp-kpis > div.up { border-left-color: var(--rp-up); }
.rp-kpis > div.down { border-left-color: var(--rp-down); }
.rp-kpis > div > span { font-size: 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--rp-dim); font-weight: 700; }
.rp-kpis b { font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--rp-ink); }
.rp-kpis > div.up b { color: var(--rp-up); }
.rp-kpis > div.down b { color: var(--rp-down); }
.rp-kpis b.sm { font-size: 11.5px; }
.rp-kpis em { font-style: normal; font-size: 9.5px; color: var(--rp-dim); }

.rp-block { padding: 8px 28px 0; min-width: 0; }
.rp-block h3 { font-size: 10.5px; margin: 6px 0 6px; display: flex; align-items: center; gap: 7px; color: var(--rp-ink);
  text-transform: uppercase; letter-spacing: .06em; }
.rp-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--rp-brand); }
.rp-dot.up { background: var(--rp-up); }
.rp-dot.down { background: var(--rp-down); }
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.rp-two .rp-block:first-child { padding-right: 10px; }
.rp-two .rp-block:last-child { padding-left: 10px; }

.rp-table { width: 100%; border-collapse: collapse; font-size: 9.5px; table-layout: fixed; }
.rp-table th { position: static; background: #0b2a5b; color: #fff; font-size: 7.5px; letter-spacing: .06em; padding: 4px 5px;
  text-align: left; border: 0; }
.rp-table th:first-child { border-top-left-radius: 5px; width: 24px; }
.rp-table th:last-child { border-top-right-radius: 5px; }
.rp-table td { padding: 3.5px 5px; border-bottom: 1px solid var(--rp-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.rp-table tbody tr:nth-child(even) td { background: #f8fafd; }
.rp-table tbody tr:hover { background: none; }
.rp-table .r { text-align: right; }
.rp-table .rk { color: var(--rp-dim); font-weight: 700; }
.rp-table .mono { font-family: var(--mono); font-size: 9.5px; color: var(--rp-brand); }
.rp-table .nm { color: var(--rp-ink); }
.rp-table .ct { font-size: 8px; color: var(--rp-dim); margin-top: 1px; }
.rp-table .ct-cell { color: var(--rp-dim); font-size: 8.5px; }
.rp-table .bar-col { width: 52px; }
.rp-two .rp-table th:nth-child(3) { width: 62px; }
.rp-two .rp-table th:nth-child(4) { width: 50px; }
.rp-two .rp-table th:nth-child(5) { width: 30px; }
.rp-two .rp-table .bar-col { width: 40px; }
.rp-inv th:nth-child(3) { width: 110px; }
.rp-inv th:nth-child(4), .rp-inv th:nth-child(5), .rp-inv th:nth-child(6) { width: 62px; }
.rp-inv th:nth-child(7) { width: 30px; }
.rp-bar { display: block; height: 6px; border-radius: 99px; background: var(--rp-soft); overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--rp-brand); }
.rp-bar.up i { background: var(--rp-up); }
.rp-bar.down i { background: var(--rp-down); }
.rp-grade { display: inline-block; min-width: 20px; text-align: center; padding: 1px 4px; border-radius: 4px; color: #fff; font-weight: 800; font-size: 8px; }
.rp-grade.g-ap { background: #0b7a45; }
.rp-grade.g-a { background: #34a26b; }
.rp-grade.g-b { background: #c58b12; }
.rp-grade.g-c { background: #e0742b; }
.rp-grade.g-d { background: #d43d43; }

.rp-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 22px; }
.rp-cat { display: grid; grid-template-columns: 112px 1fr 72px; align-items: center; gap: 7px; font-size: 9px; }
.rp-cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rp-ink); }
.rp-cat-track { position: relative; height: 8px; background: var(--rp-soft); border-radius: 99px; }
.rp-cat-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #c5cfdd; }
.rp-cat-track i { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.rp-cat-track i.up { left: 50%; background: var(--rp-up); }
.rp-cat-track i.down { right: 50%; background: var(--rp-down); }
.rp-cat-val { text-align: right; font-weight: 700; }

.rp-footer { margin-top: auto; display: flex; justify-content: space-between; gap: 18px; padding: 9px 28px; font-size: 7.5px;
  color: var(--rp-dim); border-top: 1px solid var(--rp-line); background: var(--rp-soft); }
.rp-footer span:last-child { white-space: nowrap; font-weight: 700; }

/* BES modelleri: Model Portföyler düzeni, kartlar arası boşluk */
#besProf { margin: 16px 0; }
#besProf ~ .card, #besProf ~ section { margin-top: 16px; }

/* Quant / Backtest terimleri */
.bt-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 18px; margin: 14px 0 4px; }
.bt-terms div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 9px 12px; }
.bt-terms dt { font-weight: 800; font-size: .84rem; margin-bottom: 3px; }
.bt-terms dd { margin: 0; font-size: .8rem; line-height: 1.45; opacity: .9; }

/* Kişisel portföy */
.pf-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--border); }
.pf-bar i { display: block; height: 100%; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: .86rem; }
.pf-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pf-legend em { font-style: normal; color: var(--text-dim); margin-left: 4px; }
.pr-classes { display: grid; gap: 6px; }
.pr-class { display: grid; grid-template-columns: 120px 1fr 52px 96px; gap: 9px; align-items: center; font-size: 9.5px; }
.pr-class-name { display: flex; align-items: center; gap: 6px; color: var(--rp-ink); }
.pr-class-name i { width: 9px; height: 9px; border-radius: 2px; }
.pr-class .num { text-align: right; }
.pr-pos th:nth-child(3) { width: 112px; }
.pr-pos th:nth-child(4) { width: 82px; }
.pr-pos th:nth-child(5) { width: 50px; }
.pr-pos th:nth-child(6) { width: 78px; }
.pr-pos th:nth-child(7) { width: 50px; }
.pr-pos th:nth-child(8) { width: 32px; }

/* Kişisel portföy raporu (Analiz rapor düzeni) */
.pa-note { margin: 5px 0 0; font-size: 8.5px; color: var(--rp-dim); }
.pa-empty { padding: 8px 10px; border-radius: 6px; border: 1px dashed var(--rp-line); color: var(--rp-dim); font-size: 9.5px; }
.pa-list { margin: 0; padding-left: 15px; display: grid; gap: 3px; font-size: 9.5px; }
.pa-alert { margin-top: 6px; padding: 6px 9px; border-radius: 6px; background: #fdf3e1; border-left: 3px solid #b7791f; font-size: 9.5px; }
.pa-cats { display: grid; gap: 3px; }
.pa-cat { display: grid; grid-template-columns: 128px 1fr 78px; align-items: center; gap: 7px; font-size: 9.5px; }
.pa-cat.main { font-weight: 700; }
.pa-cat.model .pa-cat-name { color: var(--rp-brand); font-weight: 600; }
.pa-cat.total { border-top: 1px solid var(--rp-line); padding-top: 3px; font-weight: 700; }
.pa-cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rp-ink); }
.pa-cat-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-table tr.main td { background: #e7f0ff !important; font-weight: 700; }
.rp-table tr.model td { color: var(--rp-brand); }
.rp-table tr.model td:first-child { font-weight: 600; }
.rp-table tfoot td { font-weight: 700; border-top: 1.5px solid #0b2a5b; border-bottom: 0; padding: 3.5px 5px; }
.pa-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; margin-bottom: 7px; }
.pa-stack span { min-width: 3px; }
.pa-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 22px; font-size: 9.5px; }
.pa-legend div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pa-legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.pa-legend span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-legend b { font-variant-numeric: tabular-nums; }
.pa-legend em { font-style: normal; font-size: 8.5px; color: var(--rp-dim); }
.pa-pos th:nth-child(2) { width: 62px; }
.pa-pos th:nth-child(3) { width: 76px; }
.pa-pos th:nth-child(4) { width: 48px; }
.pa-pos th:nth-child(5) { width: 70px; }
.pa-pos th:nth-child(6) { width: 48px; }
.pa-pos th:nth-child(7) { width: 30px; }
.pa-table th:not(:first-child) { width: 13.5%; }
.pa-compact td { padding-top: 2.2px; padding-bottom: 2.2px; font-size: 9px; }
.pa-cats { gap: 2px; }
.pa-cat { font-size: 9px; }
.rp-page .rp-bar.brand i { background: var(--rp-brand); }

/* Model Rapor */
.mr-note { margin: 4px 0 0; font-size: 8px; color: var(--rp-dim); }
.rp-kpis.mr-kpis6 { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.rp-kpis.mr-kpis6 > div { padding: 8px 9px; }
.rp-kpis.mr-kpis6 b { font-size: 14px; }
.rp-kpis.mr-kpis6 em { font-size: 8.5px; }
.mr-tag { display: inline-block; font-size: 7px; font-weight: 800; letter-spacing: .05em; padding: 0 4px; border-radius: 3px;
  background: var(--rp-soft); color: var(--rp-brand); border: 1px solid var(--rp-line); vertical-align: 1px; }
.rp-page .dim { color: var(--rp-dim); }
.rp-table .mr-bench td { color: #475569; }
.rp-table .mr-bench td:first-child b { font-weight: 600; }
.rp-table tr.mr-bench:first-of-type td, .mr-sum tr.mr-self + tr.mr-bench td { border-top: 1.5px solid #c5cfdd; }
.mr-sum th:first-child { width: 150px; }
.mr-sum td, .mr-beat td, .mr-heatmap td { padding-top: 2.4px; padding-bottom: 2.4px; }
.mr-heatmap th:first-child { width: 112px; }
.mr-heatmap td.mr-heat { text-align: center; font-variant-numeric: tabular-nums; font-size: 8.5px; color: var(--rp-ink); padding: 2px 2px;
  border-bottom: 1px solid #fff; border-right: 1px solid #fff; }
.mr-heatmap td.mr-heat.strong { color: #fff; font-weight: 700; }
.mr-heatmap tbody tr:nth-child(even) td.mr-heat { background-clip: padding-box; }
.mr-beat th:first-child { width: 112px; }
.mr-chart { width: 100%; height: auto; display: block; }
.mr-chart text { font-size: 8px; fill: var(--rp-dim); font-family: var(--mono); }
.mr-chart text.end { font-weight: 700; font-size: 7.5px; }
.mr-chart line.grid { stroke: var(--rp-line); stroke-width: 1; }
.mr-chart line.base { stroke: #9fb0c6; stroke-width: 1; stroke-dasharray: 2 2; }
.mr-two { grid-template-columns: 1.55fr 1fr; }
.mr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 5px; }
.mr-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--rp-line); border-radius: 999px;
  background: #fff; color: var(--rp-ink); font-size: 9.5px; cursor: pointer; }
.mr-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mr-chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.mr-cmp { display: grid; gap: 7px; padding-top: 2px; }
.mr-cmp-row { display: grid; grid-template-columns: 82px 1fr 66px; grid-template-rows: auto auto; column-gap: 7px; align-items: center; font-size: 9px; }
.mr-cmp-name { display: flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--rp-ink); }
.mr-cmp-name i { width: 8px; height: 3px; border-radius: 2px; flex: none; }
.mr-cmp-row > .num { text-align: right; }
.mr-cmp-sub { grid-column: 1 / -1; font-size: 7.5px; color: var(--rp-dim); padding-left: 13px; }
.mr-month td { padding-top: 2.6px; padding-bottom: 2.6px; }
.mr-month th:first-child { width: 112px; }
.mr-month th:nth-child(2) { width: 62px; }
.mr-month th:last-child { width: 92px; }
.mr-month th:nth-last-child(2) { width: 70px; }
.mr-month td.mr-model { background: #eef4fd !important; }
.mr-month td.mr-win { color: var(--rp-brand); font-weight: 800; }
.mr-month tr.mr-partial td { font-style: italic; }
.mr-month.mr-dense td { padding-top: 1.6px; padding-bottom: 1.6px; font-size: 9px; }

@media screen and (max-width: 760px) {
  /* Telefonda yatay taşma: anahtar-değer tabloları ve filtre alanları ekrana sığsın. Yalnızca ekran:
     e-postadaki PDF dar pencerede basıldığında rapor düzeni bozulmasın */
  table.kv { table-layout: fixed; width: 100%; }
  table.kv th, table.kv td { white-space: normal; overflow-wrap: anywhere; }
  #app input, #app select { max-width: 100%; min-width: 0; }
  .rp-page { aspect-ratio: auto; font-size: 10px; }
  .rp-kpis { grid-template-columns: 1fr 1fr; padding: 12px 14px 4px; }
  .rp-kpis.mr-kpis6 { grid-template-columns: 1fr 1fr; }
  /* Telefonda geniş rapor tabloları sıkışmasın: blok içinde yatay kaydırılır */
  .rp-block { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rp-block > .rp-table.mr-sum, .rp-block > .rp-table.mr-beat, .rp-block > .rp-table.mr-month, .rp-block .pa-table { min-width: 560px; }
  .rp-block > .rp-table.mr-heatmap { min-width: 720px; }
  /* Grafik açıklamaları parmakla basılabilsin */
  .chart-legend .item, .mr-chip { min-height: 32px; padding: 4px 8px; }
  .rp-block, .rp-cover, .rp-footer { padding-left: 14px; padding-right: 14px; }
  .rp-two { grid-template-columns: 1fr; }
  .rp-two .rp-block:first-child, .rp-two .rp-block:last-child { padding: 8px 14px 0; }
  .rp-cats { grid-template-columns: 1fr; }
  .rp-table .bar-col, .rp-table .ct-cell, .rp-table .cat-col { display: none; }
  /* Telefonda kategori sütunu başlığıyla birlikte gizlenir; fon kodu ve adı için yer kalır */
  .rp-inv th:nth-child(4), .rp-inv th:nth-child(5), .rp-inv th:nth-child(6) { width: 54px; }
  .rp-inv th:nth-child(7) { width: 28px; }
}

/* Yazdırma / PDF: yalnızca rapor sayfaları, her biri bir A4 */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .footer, .no-print { display: none !important; }
  .app-shell { display: block; }
  .main-column { padding: 0 !important; }
  .app { padding: 0 !important; max-width: none; display: block; }
  .rp-doc { display: block; }
  .rp-page { width: 210mm; height: 297mm; max-width: none; aspect-ratio: auto; border-radius: 0; box-shadow: none;
    break-after: page; page-break-after: always; margin: 0; }
  .rp-page:last-child { break-after: auto; page-break-after: auto; }
}

/* Aylık bildirim kurulum kartı (yalnızca ana ekran uygulamasında, kurulum bitene kadar) */
.push-setup { padding: 16px 28px 0; }
.push-card h2 { font-size: 1rem; margin: 0 0 6px; }
.push-card p { margin: 0 0 10px; }
.push-login { display: grid; gap: 8px; max-width: 360px; }
.push-login label { display: grid; gap: 4px; font-size: .85rem; }
.push-err { color: var(--down, #d6404a); font-size: .85rem; margin-top: 6px; }
@media (max-width: 640px) { .push-setup { padding: 12px 12px 0; } }
/* Bildirim zili: yalnızca telefonda, tema düğmesinin solunda; açıkken dolu ve renkli */
.push-btn { display: none; color: var(--text-dim); }
.push-btn.is-on { color: var(--brand); }
.push-btn svg { display: block; margin: auto; }
@media (max-width: 900px) { .push-btn { display: inline-flex; align-items: center; justify-content: center; } }
.push-card h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.push-close { width: 30px; height: 30px; min-height: 30px; font-size: .8rem; }
.push-toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 10px; background: #12233d; color: #fff; font-size: .85rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); }
/* Telefonda dönem düğmeleri ("1 Hafta", "Başından Beri") iki satıra bölünmesin: tek satır, gerekirse yatay kaydırma */
@media (max-width: 640px) { #pfWin { max-width: 100%; overflow-x: auto; } #pfWin button { white-space: nowrap; } }
