
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2ff;
  --text: #172033;
  --muted: #64748b;
  --line: #dce3ef;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --accent: #0f766e;
  --danger: #b91c1c;
  --shadow: 0 18px 50px rgba(23, 32, 51, .09);
  --radius: 18px;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); line-height: 1.65; }
a { color: inherit; }
img, canvas { max-width: 100%; }
button, input, select { font: inherit; }
.container { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--text); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 999; }
.skip-link:focus { left: 8px; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(220,227,239,.85); }
.nav-wrap { min-height: 70px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.25); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { text-decoration: none; color: #344158; font-weight: 650; font-size: 14px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--primary); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 11px; }
.hero { padding: 74px 0 48px; background: radial-gradient(circle at 80% 10%, rgba(124,58,237,.14), transparent 30%), radial-gradient(circle at 10% 20%, rgba(15,118,110,.11), transparent 28%); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; color: var(--primary-dark); background: #eef2ff; font-weight: 750; font-size: 13px; }
.hero h1 { max-width: 880px; margin: 18px 0 18px; font-size: clamp(40px, 7vw, 72px); line-height: 1.04; letter-spacing: -.045em; }
.hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--primary); color: #fff; font-weight: 750; text-decoration: none; cursor: pointer; box-shadow: 0 10px 25px rgba(79,70,229,.18); }
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:hover { border-color: #aab7cb; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.trust-pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.85); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: #3f4d63; font-size: 13px; font-weight: 700; }
.section { padding: 64px 0; }
.section.alt { background: #fff; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.03em; }
.section-head p { max-width: 600px; margin: 0; color: var(--muted); }
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 26px; }
.category-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; color: #46546a; cursor: pointer; font-weight: 700; }
.category-tabs button.active { background: var(--text); border-color: var(--text); color: #fff; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card-link { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-decoration: none; box-shadow: 0 8px 30px rgba(23,32,51,.04); transition: .18s ease; }
.tool-card-link:hover { transform: translateY(-4px); border-color: #b9c4d7; box-shadow: var(--shadow); }
.tool-icon { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding-inline: 9px; border-radius: 14px; color: var(--primary-dark); background: var(--surface-2); font-weight: 850; letter-spacing: -.03em; }
.tool-card-link h3 { margin: 16px 0 6px; font-size: 19px; letter-spacing: -.015em; }
.tool-card-link p { margin: 0; color: var(--muted); font-size: 14px; }
.category-label { display: inline-block; margin-top: 16px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.page-hero { padding: 48px 0 28px; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }
.page-hero h1 { margin: 0 0 12px; font-size: clamp(34px, 5vw, 54px); letter-spacing: -.04em; line-height: 1.08; }
.page-hero p { max-width: 780px; margin: 0; color: var(--muted); font-size: 18px; }
.tool-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; padding-bottom: 50px; }
.tool-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; background: #ecfdf5; border: 1px solid #a7f3d0; color: #155e4b; border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 18px; }
.dropzone { display: grid; place-items: center; min-height: 210px; border: 2px dashed #b9c4d7; border-radius: 16px; background: #f8fafc; padding: 24px; text-align: center; cursor: pointer; transition: .15s ease; }
.dropzone.dragover { background: #eef2ff; border-color: var(--primary); }
.dropzone strong { font-size: 18px; }
.dropzone p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-summary { margin: 14px 0 0; padding: 0; list-style: none; color: #46546a; font-size: 13px; max-height: 140px; overflow: auto; }
.file-summary li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #edf1f7; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: #46546a; font-weight: 750; }
.field input:not([type="checkbox"]), .field select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--text); }
.field input[type="range"] { width: 100%; accent-color: var(--primary); }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.range-line { display: flex; align-items: center; gap: 10px; }
.range-value { min-width: 48px; text-align: right; color: var(--primary-dark); font-weight: 800; font-size: 13px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.status { display: none; margin-top: 15px; border-radius: 11px; padding: 11px 13px; font-size: 14px; }
.status.show { display: block; }
.status.info { background: #eff6ff; color: #1e40af; }
.status.error { background: #fef2f2; color: var(--danger); }
.status.success { background: #ecfdf5; color: #166534; }
.result-panel { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }
.result-panel[hidden] { display: none; }
.preview-wrap { display: grid; place-items: center; min-height: 240px; border-radius: 15px; background: repeating-conic-gradient(#eef2f7 0 25%, #fff 0 50%) 50% / 24px 24px; border: 1px solid var(--line); overflow: hidden; padding: 14px; }
.preview-wrap canvas { max-height: 520px; width: auto; object-fit: contain; box-shadow: 0 10px 28px rgba(23,32,51,.12); }
.result-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.stat { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 13px; color: #46546a; }
.download-btn { background: var(--accent); box-shadow: 0 10px 25px rgba(15,118,110,.18); }
.download-btn:hover { background: #115e59; }
.sidebar-card { position: sticky; top: 94px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.sidebar-card h2 { font-size: 16px; margin: 0 0 10px; }
.sidebar-card ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.ad-placeholder { margin-top: 18px; min-height: 250px; display: grid; place-items: center; color: #94a3b8; border: 1px dashed #cbd5e1; background: #f8fafc; border-radius: 12px; font-size: 12px; text-align: center; padding: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
.prose { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; }
.prose h2 { margin: 32px 0 12px; font-size: 27px; letter-spacing: -.025em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 24px 0 8px; }
.prose p, .prose li { color: #46546a; }
.prose table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; white-space: nowrap; }
.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 800; }
.faq p { margin-bottom: 0; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.related-grid a { text-decoration: none; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-weight: 750; }
.related-grid a:hover { border-color: var(--primary); color: var(--primary); }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.calc-result { margin-top: 18px; padding: 18px; border-radius: 14px; background: #eef2ff; color: #312e81; }
.calc-result strong { display: block; font-size: 26px; }
.site-footer { margin-top: 72px; background: #111827; color: #dbe3ef; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; padding: 48px 0; }
.site-footer p, .site-footer a { color: #aeb9cb; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #283247; padding: 18px 0; color: #8f9cb2; font-size: 13px; }
.cookie-banner { position: fixed; inset: auto 16px 16px 16px; z-index: 100; max-width: 720px; margin: auto; display: none; gap: 14px; align-items: center; background: #111827; color: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 18px 55px rgba(0,0,0,.25); }
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; font-size: 13px; color: #d8e0ed; }
.cookie-banner .btn { padding: 9px 13px; white-space: nowrap; }
.hidden { display: none !important; }
@media (max-width: 900px) {
  .tool-grid, .related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tool-shell, .content-grid { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }
  .ad-placeholder { min-height: 110px; }
}
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; left: 16px; right: 16px; top: 64px; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 10px; }
  .hero { padding-top: 48px; }
  .tool-grid, .related-grid, .footer-grid { grid-template-columns: 1fr; }
  .control-grid, .calc-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .tool-panel, .prose { padding: 18px; }
  .cookie-banner { align-items: stretch; flex-direction: column; }
}
@media print {
  .site-header, .site-footer, .sidebar-card, .cookie-banner, .action-row, .dropzone, .privacy-note { display: none !important; }
  body { background: #fff; }
  .tool-shell, .content-grid { display: block; }
  .tool-panel, .prose { box-shadow: none; border: 0; padding: 0; }
}


/* ============================================================
   Advertising placements and consent controls
   ============================================================ */
.ad-placement {
  display: none;
  clear: both;
  text-align: center;
  margin: 20px auto;
}
body.ads-enabled .ad-placement.ad-wide,
body.ads-enabled .ad-placement.ad-desktop {
  display: block;
}
body.ads-enabled .ad-placement.ad-mobile {
  display: none;
}
.ad-label {
  margin: 0 0 7px;
  color: #7b879a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1;
  text-transform: uppercase;
}
.ad-frame {
  display: block;
  margin: 0 auto;
  border: 0;
  overflow: hidden;
  background: transparent;
}
.ad-frame-160 { width: 160px; height: 300px; }
.ad-frame-320 { width: 320px; height: 50px; max-width: 100%; }
.ad-mobile-container { padding-bottom: 30px; }
.home-ad-section { padding: 2px 0 44px; }
.sponsored-link {
  display: none;
  width: fit-content;
  margin: 12px auto 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #59677d;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
body.ads-enabled .sponsored-link { display: inline-flex; }
.sponsored-link:hover { color: var(--primary); border-color: #aeb9cb; }
.cookie-banner { max-width: 820px; }
.cookie-copy { flex: 1; }
.cookie-copy strong { display: block; margin-bottom: 4px; font-size: 14px; }
.cookie-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cookie-actions .btn.secondary-dark {
  color: #fff;
  background: transparent;
  border: 1px solid #536078;
  box-shadow: none;
}
.cookie-actions .btn.secondary-dark:hover { background: #253047; }
.ad-choice-btn { margin-top: 8px; }

@media (max-width: 900px) {
  body.ads-enabled .ad-placement.ad-desktop { display: none; }
  body.ads-enabled .ad-placement.ad-mobile { display: block; }
  .ad-mobile-container { padding-left: 0; padding-right: 0; }
}
@media (max-width: 700px) {
  .cookie-actions { width: 100%; justify-content: stretch; }
  .cookie-actions .btn { flex: 1 1 180px; }
}
@media print {
  .ad-placement,
  .sponsored-link,
  .home-ad-section { display: none !important; }
}
