:root {
  --bg: #0f172a;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --good: #16a34a;
  --bad: #dc2626;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f1f5f9;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-header {
  background: var(--bg);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.logo-mark { color: #facc15; }
.nav { display: flex; flex-wrap: nowrap; gap: 4px; }
.nav a {
  color: #cbd5e1; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .9rem; white-space: nowrap;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-toggle {
  display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; width: 44px; height: 40px; font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.nav-toggle:hover, .nav-toggle:focus-visible { background: rgba(255,255,255,.12); }

/* Grouped dropdown navigation */
.nav { align-items: center; }
.nav-group { position: relative; }
.nav-group-btn {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; cursor: pointer;
  color: #cbd5e1; font: inherit; font-size: .9rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}
.nav-group-btn:hover, .nav-group-btn.active, .nav-group.open .nav-group-btn { background: rgba(255,255,255,.12); color: #fff; }
.nav-group-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 1px; }
.nav-caret { font-size: .7rem; transition: transform .2s; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-menu { display: none; }
.nav-menu a { display: block; }

@media (min-width: 768px) {
  .nav-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; z-index: 30;
    background: var(--bg); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 6px;
    box-shadow: 0 14px 30px rgba(15,23,42,.35);
  }
  .nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
  .nav-group:last-child .nav-menu { left: auto; right: 0; }
  .nav-menu a { padding: 9px 12px; }
  .nav-group.open .nav-menu { display: block; }
}
@media (min-width: 768px) and (hover: hover) {
  .nav-group:hover .nav-menu { display: block; }
  .nav-group:hover .nav-caret { transform: rotate(180deg); }
}
@media (min-width: 768px) and (max-width: 899px) {
  .nav-group-btn { padding: 6px 8px; font-size: .86rem; }
}

/* Mobile: hamburger + slide-down menu */
@media (max-width: 767px) {
  .site-header { padding: 12px 16px; flex-wrap: nowrap; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 0 16px;
    background: var(--bg); border-top: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 24px rgba(15,23,42,.25);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .3s ease, padding .3s ease, visibility 0s linear .3s;
  }
  .nav.open {
    max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; padding: 8px 16px 14px; visibility: visible;
    transition: max-height .3s ease, padding .3s ease, visibility 0s;
  }
  .nav { align-items: stretch; }
  .nav a { padding: 12px; font-size: 1rem; }
  .nav-group-btn { width: 100%; justify-content: space-between; padding: 12px; font-size: 1rem; font-weight: 600; color: #fff; }
  .nav-group.open .nav-menu { display: block; padding: 0 0 6px 12px; border-left: 2px solid rgba(165,180,252,.35); margin-left: 12px; }
  .nav-menu a { padding: 10px 12px; font-size: .97rem; }
  main { padding: 24px 16px; }
  .panel { padding: 18px; }
}
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 20px; }
.hero { text-align: center; padding: 24px 0 32px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; }
.accent { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.card .icon { font-size: 1.8rem; }
.card h3 { margin: 8px 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
h2 { margin-top: 0; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; width: 100%;
  background: #fff; color: var(--text); line-height: 1.4; margin: 0;
}
input[type="text"], input[type="email"], input[type="number"], select { height: 44px; }
input[type="email"] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; }
input[type="color"] { width: 60px; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > label { flex: 1 1 180px; }
.drop {
  border: 2px dashed #c7d2fe; background: #eef2ff; border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer; color: var(--accent-dark);
}
.drop.dragover { background: #e0e7ff; border-color: var(--accent); }
.drop input { display: none; }
.btn {
  align-self: flex-start; background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 22px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: #e2e8f0; color: var(--text); }
.btn-ghost:hover { background: #cbd5e1; }
.status { margin: 0; color: var(--muted); min-height: 1.5em; }
.direct-contact {
  margin-top: 20px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px;
  background: #f8fafc; color: var(--text); line-height: 1.6;
}
.direct-contact p { margin: 0; }
.direct-contact a { color: var(--accent-dark); font-weight: 700; text-decoration: none; word-break: break-all; }
.direct-contact a:hover, .direct-contact a:focus { text-decoration: underline; }
.direct-contact .response-time { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.status.error { color: var(--bad); }
.results { display: flex; flex-direction: column; gap: 10px; }
.result {
  display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px;
}
.result img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
.result .info { flex: 1; font-size: .9rem; word-break: break-all; }
.result .saved { color: var(--good); font-weight: 700; }
.result a { white-space: nowrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stats div { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.stats strong { display: block; font-size: 1.5rem; color: var(--accent-dark); }
.stats span { color: var(--muted); font-size: .85rem; }
.qr-output { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.qr-output canvas { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
.pw-box { display: flex; gap: 8px; }
.pw-box input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; }
.strength { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
#pw-strength-bar { height: 100%; width: 0; transition: width .2s, background .2s; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.checks label { flex-direction: row; align-items: center; font-weight: 500; }
.site-footer { text-align: center; color: var(--muted); padding: 20px 20px 100px; font-size: .85rem; } /* +80px bottom so the Netlify badge never covers footer links */


/* Footer links */
.site-footer p { margin: 8px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
.footer-links a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

/* Content pages */
.page { line-height: 1.7; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 12px; }
.page h2 { margin: 18px 0 4px; font-size: 1.2rem; }
.page p, .page li { color: #334155; margin: 0; }
.page ul { margin: 0; padding-left: 20px; }
.page .updated { color: var(--muted); font-size: .9rem; }
.form-success { color: var(--good); font-weight: 700; }
.hidden-field { display: none; }

/* Tool page heading */
.tool h1 { font-size: clamp(1.6rem, 4vw, 2rem); margin: 0 0 6px; }
.tool-intro { color: var(--muted); margin: 0 0 18px; }

/* SEO articles below tools / on homepage */
.article {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; margin-top: 28px; line-height: 1.75; color: #334155;
}
.article h2 { color: var(--text); font-size: 1.35rem; margin: 28px 0 10px; }
.article h2:first-child { margin-top: 0; }
.article h3 { color: var(--text); font-size: 1.05rem; margin: 20px 0 6px; }
.article p { margin: 0 0 12px; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article li::marker { color: var(--accent); font-weight: 700; }
.article strong { color: var(--text); }
.article a { color: var(--accent-dark); }
.article .faq h3 { padding-top: 16px; border-top: 1px solid var(--border); }
.article .faq h3:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 767px) { .article { padding: 20px; } }

/* Cookie consent banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  max-width: 760px; margin: 0 auto; background: var(--bg); color: #e2e8f0;
  border-radius: var(--radius); padding: 14px 18px; box-shadow: 0 12px 32px rgba(15,23,42,.3);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  transform: translateY(140%); transition: transform .3s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner.hide { transform: translateY(140%); }
.cookie-banner p { margin: 0; flex: 1 1 280px; font-size: .9rem; }
.cookie-banner a { color: #a5b4fc; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-actions .btn { padding: 9px 18px; }

/* Ad slot (300x250 banner) — reserved space so the page doesn't jump and ads never overlap tool controls */

/* Label shown above the banner ad so it is not confused with tool buttons */
.ad-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-align: center;
}

/* ===== Shared controls for newer tools ===== */
input[type="date"] {
  font: inherit; height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  width: 100%; background: #fff; color: var(--text); margin: 0;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
input.invalid { border-color: var(--bad); background: #fef2f2; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 1px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { align-self: auto; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.inline-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; margin: 0; }
.field-copy { display: flex; gap: 8px; }
.field-copy input { font-family: ui-monospace, Menlo, Consolas, monospace; }
.field-copy .btn { white-space: nowrap; }

/* Image resizer */
.preview-wrap {
  background: repeating-conic-gradient(#e2e8f0 0 25%, #f8fafc 0 50%) 0 0 / 20px 20px;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; overflow: hidden;
}
.preview-wrap canvas { max-width: 100%; max-height: 420px; height: auto; width: auto; display: inline-block; vertical-align: middle; box-shadow: 0 4px 14px rgba(15,23,42,.12); }

/* Age calculator */
.big-result {
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: var(--radius); padding: 18px; text-align: center;
}
.big-result .value { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; color: var(--accent-dark); display: block; }
.big-result .sub { color: var(--muted); font-size: .92rem; }

/* PDF merger file list */
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #f8fafc;
}
.file-item .num { font-weight: 800; color: var(--accent-dark); min-width: 1.6em; }
.file-item .info { flex: 1; min-width: 0; font-size: .92rem; }
.file-item .name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta { color: var(--muted); font-size: .82rem; }
.file-item .actions { display: flex; gap: 4px; }
.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  cursor: pointer; font: inherit; font-size: 1rem; line-height: 1; color: var(--text);
}
.icon-btn:hover:not(:disabled) { background: #e0e7ff; border-color: #c7d2fe; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.remove:hover { background: #fee2e2; border-color: #fecaca; color: var(--bad); }

/* EMI calculator */
.slider-field { display: flex; flex-direction: column; gap: 8px; }
.slider-field .slider-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: .92rem; }
.slider-field .slider-head .inputs { display: flex; gap: 6px; }
.slider-field input[type="number"] { width: 160px; }
.slider-field select { width: auto; }
.breakdown-bar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; background: #e2e8f0; }
.breakdown-bar span { height: 100%; transition: width .25s; }
.bar-principal { background: var(--accent); }
.bar-interest { background: #f59e0b; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Color picker */
.color-layout { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 20px; align-items: start; }
.color-preview {
  border-radius: var(--radius); border: 1px solid var(--border); min-height: 180px;
  display: flex; align-items: flex-end; padding: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
}
.color-layout input[type="color"] { width: 100%; height: 56px; cursor: pointer; }
.color-fields { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 640px) {
  .color-layout { grid-template-columns: 1fr; }
  .slider-field input[type="number"] { width: 130px; }
  .file-item { flex-wrap: wrap; }
}
.panel-inner { display: flex; flex-direction: column; gap: 16px; }
.hint code { background: #f1f5f9; border-radius: 4px; padding: 1px 5px; }

