/* Yerel fontlar: Türkçe karakterler için latin + latin-ext */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/fonts/playfair-display-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/fonts/playfair-display-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #0a1020;
  --bg-2: #0d1529;
  --surface: #111b33;
  --surface-2: #16223f;
  --line: rgba(217, 177, 59, 0.34);
  --line-soft: rgba(148, 163, 184, 0.16);
  --gold: #d9b13b;
  --gold-2: #f0cf6a;
  --gold-ink: #1a1405;
  --text: #e8ecf5;
  --muted: #a0aac0;
  --up: #2fd39a;
  --up-bg: rgba(47, 211, 154, 0.13);
  --down: #ff6b78;
  --down-bg: rgba(255, 107, 120, 0.13);
  --warn: #f0b429;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ikonlar */
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.logo { width: 40px; height: 40px; flex: none; border-radius: 11px; box-shadow: 0 6px 20px rgba(217, 177, 59, 0.25); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* düğmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: rgba(217, 177, 59, 0.1); border-color: var(--gold); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); color: var(--gold-ink); }
.btn-danger { border-color: rgba(255, 107, 120, 0.4); color: var(--down); }
.btn-danger:hover { background: var(--down-bg); border-color: var(--down); color: var(--down); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-ghost { border-color: transparent; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgba(217, 177, 59, 0.1); color: var(--gold-2); border-color: var(--line); }

/* rozet / çip */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--gold); background: rgba(217, 177, 59, 0.07); white-space: nowrap; }
.chip.up { color: var(--up); background: var(--up-bg); border-color: transparent; }
.chip.down { color: var(--down); background: var(--down-bg); border-color: transparent; }
.chip.flat { color: var(--muted); background: rgba(148, 163, 184, 0.1); border-color: transparent; }
.chip.warn { color: var(--warn); background: rgba(240, 180, 41, 0.1); border-color: rgba(240, 180, 41, 0.3); }
.chip .ic { width: 13px; height: 13px; }

.tile { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--gold); }
.tile .ic { width: 20px; height: 20px; }
.tile.silver { color: #cfd6e4; border-color: rgba(207, 214, 228, 0.35); }
.tile.sym { font: 700 13px/1 var(--mono); letter-spacing: -0.02em; }
.tile.sym.long { font-size: 10.5px; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(47, 211, 154, 0.6); flex: none; }
.dot.live { animation: pulse 2s infinite; }
.dot.closed { background: var(--warn); }
.dot.stale { background: var(--down); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(47, 211, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 211, 154, 0); } }

.num { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }

/* formlar */
.field { display: grid; gap: 6px; }
.field > label, .lab { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 10px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  font: 500 15px var(--sans);
}
.textarea { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.5; }
.input.mono { font-family: var(--mono); font-weight: 700; }
.input::placeholder, .textarea::placeholder { color: #66718a; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(217, 177, 59, 0.2); }
.hint { font-size: 12.5px; color: var(--muted); }
.form-error { color: var(--down); font-size: 13.5px; min-height: 1.2em; }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #334060; transition: background 0.15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + i { background: var(--up); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* modal (native <dialog>) */
dialog.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.modal::backdrop { background: rgba(4, 8, 18, 0.72); backdrop-filter: blur(3px); }
.modal-body { padding: 22px; display: grid; gap: 16px; }
.modal-head { display: flex; align-items: center; gap: 12px; }
.modal-head h2 { font: 700 20px/1.2 var(--sans); }
.modal-head .x { margin-left: auto; align-self: flex-start; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* grafik */
.chart { position: relative; min-height: 120px; }
.chart-svg { display: block; max-width: 100%; touch-action: pan-y; }
.ch-grid { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.ch-txt { fill: var(--muted); font: 11px var(--mono); }
.ch-line { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ch-line-alt { fill: none; stroke: #7f8db0; stroke-width: 1.6; stroke-dasharray: 5 4; stroke-linejoin: round; }
.ch-stop-a { stop-color: var(--gold); stop-opacity: 0.32; }
.ch-stop-b { stop-color: var(--gold); stop-opacity: 0; }
.ch-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-dot { fill: var(--gold-2); stroke: var(--bg); stroke-width: 2; }
.chart-tip { position: absolute; top: 4px; pointer-events: none; display: grid; gap: 1px; padding: 7px 10px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font: 12px var(--mono); white-space: nowrap; z-index: 2; }
.chart-tip b { color: var(--gold-2); }
.chart-tip small { color: var(--muted); font-size: 11px; }
.chart-empty { min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 20px; }
.chart-empty .ic { width: 26px; height: 26px; color: var(--gold); }
.chart-empty p { max-width: 34ch; font-size: 13.5px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 700; }
.seg button[aria-pressed='true'] { background: var(--surface-2); color: var(--gold-2); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; display: flex; gap: 8px; align-items: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.toast.err { border-color: rgba(255, 107, 120, 0.5); color: #ffc9ce; }
.toast .ic { color: var(--up); }
.toast.err .ic { color: var(--down); }

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

.modal-form { display: grid; gap: 16px; }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.6; cursor: not-allowed; }
