:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #1b1f2a;
  --muted: #5b6475;
  --border: #dde2ec;
  --primary: #1f5eff;
  --primary-dark: #1546c4;
  --primary-soft: #e8efff;
  --success: #138a4b;
  --success-soft: #e4f6ec;
  --warn: #b35c00;
  --warn-soft: #fff3e0;
  --danger: #c0262d;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 30, 60, 0.07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #171b24;
    --surface-2: #1f2430;
    --text: #e8ebf2;
    --muted: #9aa3b5;
    --border: #2a3040;
    --primary: #6b93ff;
    --primary-dark: #4f7bff;
    --primary-soft: #1b2440;
    --success: #4cc98a;
    --success-soft: #16301f;
    --warn: #f0a94d;
    --warn-soft: #3a2a12;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.container { width: min(1100px, 100% - 2rem); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a { padding: .4rem .7rem; border-radius: 8px; color: var(--text); font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem; color: var(--text); font-size: 1.1rem; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 1rem 1rem; flex-direction: column; }
  .nav.open { display: flex; }
}

/* Hero */
.hero { padding: 2.5rem 0 1.5rem; text-align: center; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 680px; margin: 0 auto 1rem; }
.badge { display: inline-block; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: .2rem .75rem; font-size: .8rem; font-weight: 600; }

/* Tool grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); color: var(--text); display: block;
  transition: transform .15s, border-color .15s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.tool-card .icon { font-size: 1.6rem; display: block; margin-bottom: .4rem; }
.tool-card h3 { margin-bottom: .25rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* Layout for tool pages */
.page { padding: 1.5rem 0 3rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.breadcrumb a { color: var(--muted); }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 800px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .tool-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.panel h2 { margin-top: 0; font-size: 1.15rem; }

/* Forms */
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select {
  width: 100%; padding: .65rem .8rem; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.field.inline { display: flex; align-items: center; gap: .5rem; }
.field.inline label { margin: 0; font-weight: 500; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 3rem; }
.input-suffix span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.radio-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.radio-group label {
  flex: 1 1 auto; text-align: center; padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-weight: 500; background: var(--surface-2); font-size: .95rem;
}
.radio-group input { position: absolute; opacity: 0; }
.radio-group input:checked + span { color: var(--primary); font-weight: 700; }
.radio-group label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.btn {
  display: inline-block; padding: .75rem 1.4rem; font-size: 1rem; font-weight: 600; font-family: inherit;
  color: #fff; background: var(--primary); border: 0; border-radius: 10px; cursor: pointer; width: 100%;
  margin-top: .5rem; transition: background .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); width: auto; padding: .45rem .9rem; font-size: .875rem; margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Results */
.result { display: none; }
.result.show { display: block; }
.result-hero { background: var(--success-soft); border: 1px solid transparent; border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.result-hero .label { color: var(--muted); font-size: .85rem; }
.result-hero .value { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; color: var(--success); }
.result-hero .sub { font-size: .9rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv dd.neg { color: var(--danger); }
.kv .total { border-top: 1px solid var(--border); padding-top: .4rem; margin-top: .2rem; font-weight: 700; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: .7rem .9rem; font-size: .875rem; margin: .75rem 0; }
.info { background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: .7rem .9rem; font-size: .875rem; margin: .75rem 0; }
.error { color: var(--danger); font-size: .9rem; margin-top: .5rem; display: none; }
.error.show { display: block; }

/* Tables */
.table-wrap { overflow-x: auto; margin: .75rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 700; }

/* Article */
.article { max-width: 820px; margin-top: 2.5rem; }
.article h2 { padding-top: .5rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-bottom: .35rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem 1rem; margin-bottom: .5rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6rem 0 .2rem; color: var(--muted); }
.related { margin-top: 2.5rem; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.related li a { display: inline-block; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; }
.related li a:hover { border-color: var(--primary); text-decoration: none; }
.update-stamp { font-size: .8rem; color: var(--muted); margin-top: 1rem; }

/* Ad slots: AdSense onayı sonrası bu kutulara reklam kodu yerleştirilir */
.ad-slot { min-height: 0; margin: 1.25rem 0; text-align: center; }
.ad-slot:empty { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0; margin-top: 2rem; color: var(--muted); font-size: .9rem; }
.site-footer .cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h4 { margin: 0 0 .5rem; color: var(--text); font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer a { color: var(--muted); }
.site-footer .legal { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .8rem; }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: .9rem 1.1rem; display: none; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: .9rem; max-width: 720px; margin: 0 auto;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; flex: 1 1 300px; }

/* Static pages */
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.8em; }

@media print {
  .site-header, .site-footer, .cookie-banner, .actions, .btn, .article, .related, .ad-slot { display: none !important; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
}
