/* ChartHall — temel stiller: fontlar, renk belirteçleri, sıfırlama, ortak bileşenler. */

/* Inter — SIL OFL 1.1, öz-barındırımlı (fonts/Inter-OFL.txt). latin-ext Türkçe ş ğ İ için şart. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/inter-latin-400-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: 400; font-display: swap;
  src: url(/fonts/inter-latin-ext-400-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: 500; font-display: swap;
  src: url(/fonts/inter-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: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/inter-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: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/inter-latin-600-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: 600; font-display: swap;
  src: url(/fonts/inter-latin-ext-600-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: 700; font-display: swap;
  src: url(/fonts/inter-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; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/fonts/inter-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; }
/* IBM Plex Mono — yalnızca kod / kısayol tuşları için (fonts/IBM-Plex-Mono-OFL.txt) */
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-400-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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-ext-400-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; }

:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1114;
  --surface: #14171b;
  --surface-2: #1b1f24;
  --surface-3: #252a31;
  --border: #22262c;
  --border-strong: #31363e;
  --text: #e3e6ea;
  --text-2: #a0a7b1;
  --text-3: #767e89;
  --accent: #3a6fe8;
  --accent-hover: #4a7cf0;
  --accent-text: #7ea3f5;
  --accent-soft: rgba(58, 111, 232, 0.14);
  --on-accent: #ffffff;
  --up: #22a37a;
  --down: #e0474f;
  --warn: #d6a03e;
  --chart-bg: #0f1114;
  --chart-grid: #191c21;
  --focus: #8fb1ff;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef0f3;
  --surface-3: #e3e6ea;
  --border: #e2e5e9;
  --border-strong: #cbd0d7;
  --text: #131619;
  --text-2: #4b525c;
  --text-3: #69717c;
  --accent: #2457d6;
  --accent-hover: #1d4bc0;
  --accent-text: #1f4fc8;
  --accent-soft: rgba(36, 87, 214, 0.09);
  --on-accent: #ffffff;
  --up: #0d8a5f;
  --down: #cf3a43;
  --warn: #946200;
  --chart-bg: #ffffff;
  --chart-grid: #f1f3f5;
  --focus: #2457d6;
  --overlay: rgba(19, 22, 25, 0.45);
  --shadow: 0 6px 20px rgba(19, 22, 25, 0.12);
}

:root {
  --font-sans: Inter, system-ui, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 4px;
  --radius-sm: 4px;
  --radius-lg: 6px;
  --header-h: 48px;
  --container: 1200px;
  --gutter: clamp(12px, 3vw, 24px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: 'cv11' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.011em; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd, .mono { font-family: var(--font-mono); }
.num, .tnum { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 6px 12px; border-radius: var(--radius);
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  font-weight: 500; font-size: 14px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-disabled='true']:hover { background: var(--surface-2); }
.btn[hidden] { display: none; }
@media (pointer: coarse) { .btn { min-height: 40px; } .btn-sm { min-height: 36px; } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid transparent;
  background: transparent; color: var(--text-2); padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
@media (pointer: coarse) { .icon-btn { width: 40px; height: 40px; } }
.theme-icon-light { display: none; }
[data-theme='light'] .theme-icon-light { display: block; }
[data-theme='light'] .theme-icon-dark { display: none; }

/* Rozetler */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.badge[data-kind='delayed']::before { background: var(--warn); }
.badge[data-kind='realtime']::before { background: var(--up); }
.badge[data-kind='daily']::before { background: var(--accent-text); }
.badge[data-kind='error']::before { background: var(--down); }
.badge-plain::before { display: none; }

.up { color: var(--up); }
.down { color: var(--down); }

/* Formlar */
.field { display: grid; gap: 5px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  min-height: 38px; width: 100%; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-size: 15px;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-3)); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.input[aria-invalid='true'] { border-color: var(--down); }
@media (pointer: coarse) { .input { font-size: 16px; min-height: 42px; } }
.form-status { min-height: 1.5em; font-size: 13px; color: var(--text-2); }
.form-status:empty { min-height: 0; }
.form-status[data-state='error'] { color: var(--down); }
.form-status[data-state='ok'] { color: var(--up); }

/* Sembol araması (site başlığı ve grafik) */
.search { position: relative; }
.search-icon { position: absolute; left: 9px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input {
  width: 100%; height: 32px; padding: 0 10px 0 30px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 500;
}
.search-input::placeholder { color: var(--text-3); font-weight: 400; }
.search-input:hover { border-color: var(--border-strong); }
.search-input:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--bg); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-list {
  position: fixed; z-index: 80; margin: 0; padding: 4px; list-style: none;
  width: 340px; max-width: calc(100vw - 16px); max-height: min(420px, 60vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.search-list[hidden] { display: none; }
.search-list li[role='option'] {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 10px; align-items: center;
  min-height: 34px; padding: 2px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.search-list li[role='option'][aria-selected='true'], .search-list li[role='option']:hover { background: var(--surface-3); }
.search-list .sym { font-weight: 600; color: var(--text); }
.search-list .nm { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-list .mk { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.search-list .msg { padding: 8px; color: var(--text-2); font-size: 13px; }

/* Üst gezinme */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.header-row { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter); max-width: 1600px; margin: 0 auto; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; color: var(--text); flex: none;
  text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.012em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; flex: none; }
.site-nav { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.site-search { width: 260px; flex: 0 1 260px; min-width: 140px; margin-left: 8px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--radius);
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current='page'] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.header-auth { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 30px; }
.header-signup[hidden], .header-auth[hidden] { display: none; }
.site-nav .nav-auth { display: none; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0; z-index: 39;
    flex-direction: column; align-items: stretch; gap: 8px; padding: 10px var(--gutter) 12px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-search { width: auto; flex: none; margin: 0; }
  .site-search .search-input { height: 40px; font-size: 16px; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a { height: 44px; font-size: 15px; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0 4px; }
  .nav-links a:last-child { border-bottom: 0; }
  .site-nav .nav-auth { display: flex; }
  .menu-toggle { display: inline-flex; }
  .header-actions .header-auth { display: none; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
}

/* Alt bilgi */
.site-footer .container { max-width: 1600px; }
.site-footer { border-top: 1px solid var(--border); padding: 20px 0 24px; margin-top: 56px; color: var(--text-3); font-size: 13px; background: var(--surface); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.footer-row .brand { font-size: 14px; }
.footer-row .brand-mark { width: 20px; height: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 2px 4px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--text-2); text-decoration: none; display: inline-block; padding: 4px 8px; border-radius: var(--radius); }
.footer-links a:hover { color: var(--text); background: var(--surface-2); }
.footer-meta { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }
.footer-meta a { color: var(--text-2); }

/* Kayıt / giriş paneli (modal) */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: max(6vh, 24px) 12px 24px; background: var(--overlay); overflow-y: auto;
}
.auth-overlay[hidden] { display: none; }
.auth-modal {
  position: relative; width: min(400px, 100%); padding: 22px 22px 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); color: var(--text);
}
.auth-modal-close { position: absolute; top: 10px; right: 10px; }
.auth-modal h2 { font-size: 18px; padding-right: 32px; }
.auth-modal .auth-lede { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }

/* Ortak kayıt / giriş formu (modal ve tam sayfa) */
.auth-form { margin-top: 16px; display: grid; gap: 12px; }
.auth-form[hidden] { display: none; }
.auth-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.auth-fieldset[disabled] { opacity: 0.6; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-link { font-size: 12.5px; }
.field-hint { font-size: 12px; color: var(--text-3); }
.auth-sep { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-hint { font-size: 12px; color: var(--text-3); }
.auth-switch { font-size: 13px; color: var(--text-2); padding-top: 12px; border-top: 1px solid var(--border); }
.auth-switch button { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: 0.18em; }
.auth-done { margin-top: 16px; display: grid; gap: 12px; font-size: 14px; color: var(--text-2); }
.auth-done[hidden] { display: none; }
.auth-done strong { color: var(--text); font-weight: 600; }
.auth-notice {
  margin-top: 14px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); font-size: 13.5px; color: var(--text-2); display: grid; gap: 10px;
}
.auth-notice[hidden] { display: none; }
.auth-notice[data-state='error'] { border-color: color-mix(in srgb, var(--down) 55%, var(--border)); }
.auth-notice-links { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-notice-links .btn { text-decoration: none; }
.auth-mock {
  margin-top: 12px; padding: 6px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--warn); font-family: var(--font-mono);
}
.auth-mock[hidden] { display: none; }

/* Yumuşak kayıt çağrısı (engel değil) */
.signup-nudge {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 70;
  width: min(640px, calc(100vw - 16px)); display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 14px; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 13px; color: var(--text-2);
}
.signup-nudge[hidden] { display: none; }
.signup-nudge p { flex: 1; min-width: 0; }
.signup-nudge .nudge-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 560px) {
  .signup-nudge { flex-wrap: wrap; bottom: calc(64px + env(safe-area-inset-bottom)); }
  .signup-nudge .nudge-actions { width: 100%; justify-content: flex-end; }
}

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