/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff;
  color: #111;
}

/* ── Nav ── */
nav {
  background: #000;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.5px;
}

nav a {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

nav a:hover {
  color: #fff;
}

nav .nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

nav .nav-links a.active {
  color: #fff;
}

/* ── Info / SEO sections (FAQ, How-To, Related Tools) ── */
.info-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.info-section h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  margin-top: 48px;
}

/* How-To steps */
.how-to-steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-to-steps li {
  counter-increment: step;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.how-to-steps li::before {
  content: counter(step);
  min-width: 28px;
  height: 28px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-list details {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.faq-list details[open] {
  border-color: #ccc;
}

.faq-list summary {
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: #888;
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s;
}

.faq-list details[open] summary::after {
  content: '−';
}

.faq-list .faq-body {
  padding: 0 18px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

/* Related tools grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.related-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.related-card:hover {
  border-color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.related-card .r-icon { font-size: 20px; flex-shrink: 0; }
.related-card .r-title { font-size: 13px; font-weight: 600; }

/* ── Touch / tap optimisation ── */
button, a, input, select, textarea, summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Mobile nav ── */
@media (max-width: 520px) {
  nav {
    padding: 0 16px;
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  nav .logo { font-size: 17px; }

  nav .nav-links { gap: 16px; }

  nav a { font-size: 13px; }
}

/* ── Responsive tool pages ── */
@media (max-width: 600px) {
  .tool-page,
  .page,
  .calc-page {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 32px;
  }

  .info-section {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 56px;
  }

  .info-section h2 { font-size: 19px; margin-top: 36px; }

  .how-to-steps li { font-size: 14px; padding: 14px 12px; gap: 10px; }

  .faq-list summary { font-size: 14px; padding: 14px 14px; }
  .faq-list .faq-body { font-size: 13px; }

  .related-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .related-card { padding: 12px; }
}

/* ── Bookmark toast ── */
#bm-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #111;
  color: #fff;
  padding: 11px 14px 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
  pointer-events: auto;
  max-width: calc(100vw - 40px);
  animation: bmIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both,
             bmOut 0.4s ease 4.2s forwards;
}

#bm-toast .bm-close {
  background: none;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
#bm-toast .bm-close:hover { color: #fff; }

@keyframes bmIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

@keyframes bmOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); pointer-events: none; }
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 12px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
  margin-top: 40px;
}
footer a { color: #aaa; text-decoration: underline; }
footer a:hover { color: #555; }

/* ── Cookie consent banner ── */
#cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px));
  background: #111;
  color: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  z-index: 10000;
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
  animation: cbIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cbIn {
  from { opacity: 0; transform: translateX(-50%) translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1);    }
}
#cookie-banner p {
  font-size: 13px;
  line-height: 1.6;
  color: #ccc;
  margin-bottom: 16px;
}
#cookie-banner p strong { color: #fff; }
#cookie-banner a { color: #aaa; text-decoration: underline; }
#cookie-banner a:hover { color: #fff; }
.cb-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cb-accept {
  background: #fff;
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
}
.cb-accept:hover { background: #eee; }
.cb-decline {
  background: transparent;
  color: #888;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
}
.cb-decline:hover { color: #fff; border-color: #666; }
