/* Kitoolz — global styles. System fonts only, mobile-first, auto dark mode. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a2233;
  --text-soft: #5a6478;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --border: #e3e7ee;
  --ok: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
  --maxw: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --surface: #1a2130;
    --text: #e8ecf4;
    --text-soft: #9aa4b8;
    --brand: #5b8cff;
    --brand-dark: #7da3ff;
    --brand-soft: #1e2a45;
    --border: #2a3245;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* 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; gap: 16px; height: 56px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.5px;
}
.logo:hover { text-decoration: none; }
.logo .logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff; display: grid; place-items: center;
  font-size: 15px; font-weight: 900;
}
.header-spacer { flex: 1; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a {
  padding: 4px 8px; border-radius: 6px; font-size: 13px; font-weight: 600;
  color: var(--text-soft); border: 1px solid transparent;
}
.lang-switch a.active { color: var(--brand); background: var(--brand-soft); }
.lang-switch a:hover { text-decoration: none; border-color: var(--border); }

/* Hero / home */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; letter-spacing: -1px; }
.hero p { color: var(--text-soft); max-width: 560px; margin: 0 auto; }
.search-wrap { max-width: 520px; margin: 24px auto 0; position: relative; }
.search-wrap input {
  width: 100%; padding: 14px 18px; font-size: 16px;
  border: 2px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); outline: none;
}
.search-wrap input:focus { border-color: var(--brand); }

/* Tool grid */
.cat-title { font-size: 20px; margin: 32px 0 12px; }
.tool-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  padding: 0; list-style: none; margin: 0 0 8px;
}
.tool-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  color: var(--text); transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.tool-card .t-icon { font-size: 22px; line-height: 1.2; }
.tool-card .t-name { font-weight: 700; font-size: 15px; }
.tool-card .t-desc { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

/* Breadcrumb */
.breadcrumb { font-size: 13px; color: var(--text-soft); margin: 16px 0 4px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin: 0 4px; color: var(--text-soft); }

/* Tool page */
.tool-page h1 { font-size: clamp(24px, 4.5vw, 32px); margin: 8px 0 6px; letter-spacing: -.5px; }
.tool-intro { color: var(--text-soft); margin: 0 0 16px; max-width: 720px; }
.tool-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; font-size: 16px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 16px;
  padding: 12px 28px; border-radius: 8px; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn-ghost {
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--border); font-weight: 600;
}
.btn-ghost:hover { background: var(--brand-soft); }
.result-box {
  margin-top: 18px; padding: 16px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid var(--brand);
  display: none;
}
.result-box.show { display: block; }
.result-main { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.result-line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 3px 0; }
.result-line span:last-child { font-weight: 700; }
.result-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.result-actions .btn, .result-actions .btn-ghost { font-size: 14px; padding: 8px 16px; }

/* Result table */
.rtable-wrap { overflow-x: auto; margin-top: 14px; }
table.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rtable th, table.rtable td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.rtable th:first-child, table.rtable td:first-child { text-align: left; }
table.rtable th { color: var(--text-soft); font-weight: 600; }

/* Ads */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px; margin: 20px 0;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 8px;
  color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
@media (min-width: 768px) { .ad-slot { min-height: 110px; } }

/* SEO content */
.seo-content { max-width: 760px; }
.seo-content h2 { font-size: 22px; margin-top: 32px; }
.seo-content h3 { font-size: 17px; }
.seo-content ol li, .seo-content ul li { margin-bottom: 6px; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.faq-item summary { padding: 12px 16px; font-weight: 600; cursor: pointer; }
.faq-item div { padding: 0 16px 12px; color: var(--text-soft); }

/* Related */
.related { margin: 32px 0; }

/* Footer */
.site-footer {
  margin-top: 48px; border-top: 1px solid var(--border);
  background: var(--surface); padding: 28px 0; font-size: 14px; color: var(--text-soft);
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }

/* Currency selector on money tools */
.currency-select {
  display: block; margin: -6px 0 12px auto; width: auto;
  padding: 6px 10px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text-soft); cursor: pointer;
}
.currency-select:focus { border-color: var(--brand); outline: none; }

/* Language suggestion bar */
.lang-suggest {
  position: fixed; top: 64px; left: 12px; right: 12px; z-index: 90;
  max-width: 480px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  padding: 12px 14px; font-size: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.lang-suggest .btn { font-size: 13px; padding: 7px 14px; }

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 100;
  max-width: 520px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  padding: 14px 16px; font-size: 14px; display: none;
}
.cookie-banner.show { display: block; }
.cookie-banner .cb-actions { margin-top: 10px; display: flex; gap: 8px; }
.cookie-banner .btn, .cookie-banner .btn-ghost { font-size: 14px; padding: 8px 18px; }

/* Utility */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
