:root {
  --bg: #0f0e12;
  --surface: #1a1820;
  --text: #f5eef2;
  --muted: #a89ba3;
  --accent: #e8a4b8;
  --accent-2: #c9d4ff;
  --border: rgba(255, 255, 255, 0.1);
  --ok: #8fd4a8;
  --warn: #f0c674;
  --radius: 16px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #2a1f28, var(--bg));
  color: var(--text);
  font-family: var(--font);
}
a { color: var(--accent-2); }
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}
.tool-shell {
  min-height: 100dvh;
}
.tool-body {
  display: flex;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-height: 100dvh;
  padding: 0.75rem 1rem 1.5rem;
  align-items: flex-start;
}
.tool-main {
  flex: 1;
  min-width: 0;
}
.tool-ad-rail {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 0.75rem;
}
.ad-slot {
  width: 100%;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  display: block;
  overflow: hidden;
}
.ad-slot--rail { min-height: 600px; }
.ad-slot--adsense {
  border-color: transparent;
  background: rgba(0, 0, 0, 0.12);
}
.ad-slot--adsense ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 250px;
}
.ad-slot--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
}
.ad-slot__label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .tool-ad-rail { display: none; }
  .tool-body { padding: 0 1rem 1.5rem; }
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
}
.topbar h1 span { color: var(--accent); }
.tagline { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nav-links a, .nav-links button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
input, select, button.primary {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #121018;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
}
button.primary {
  background: linear-gradient(135deg, #e8a4b8, #d88aa3);
  color: #1a1014;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
}
.grid-2 { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.result {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0.5rem 0;
}
.hint { color: var(--muted); font-size: 0.9rem; }
#map { height: 420px; border-radius: 12px; border: 1px solid var(--border); }
canvas.chart { width: 100%; height: 180px; background: #121018; border-radius: 12px; border: 1px solid var(--border); }
