:root {
  --blue: #1463ff;
  --blue-dark: #0a2f78;
  --ink: #102033;
  --muted: #64748b;
  --line: #d8e2f0;
  --soft: #eef6ff;
  --mint: #e9fff6;
  --amber: #fff6df;
  --rose: #fff0f3;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(16, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f7fbff;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 226, 240, 0.82);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-menu {
  gap: 8px;
}

.nav-group {
  position: relative;
}

.nav-links > a,
.nav-group > a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.nav-links > a:hover,
.nav-group:hover > a,
.nav-group > a:focus {
  background: var(--soft);
  color: var(--blue-dark);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  display: grid;
  min-width: 220px;
  padding: 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.14s, transform 0.14s;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.88rem;
  white-space: nowrap;
}

.nav-dropdown a:hover {
  background: #f1f6ff;
  color: var(--blue);
}

.hero {
  display: grid;
  min-height: 590px;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  padding: clamp(54px, 8vw, 96px) clamp(18px, 4vw, 56px) 34px;
  background:
    radial-gradient(circle at 88% 18%, rgba(32, 201, 151, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(20, 99, 255, 0.13), rgba(255, 255, 255, 0.88) 54%),
    linear-gradient(180deg, #ffffff 0%, #eff7ff 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.3rem, 10vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.hero-text {
  max-width: 720px;
  margin: 24px 0 0;
  color: #344761;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.filter,
.tool-card,
.icon-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 800;
}

.action-button {
  width: 100%;
  max-width: none;
}

.button.primary {
  background: var(--blue);
  color: var(--white);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--blue-dark);
}

.hero-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-dark);
  font-weight: 800;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #20c997;
  box-shadow: 0 0 0 8px rgba(32, 201, 151, 0.14);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-grid span {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  font-weight: 700;
}

.preview-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 clamp(18px, 4vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
  transform: translateY(-18px);
}

.trust-strip div {
  display: grid;
  gap: 5px;
  min-height: 86px;
  align-content: center;
  padding: 18px;
  background: var(--white);
}

.trust-strip strong {
  color: var(--blue-dark);
  font-size: 1rem;
}

.trust-strip span {
  color: var(--muted);
  font-size: 0.92rem;
}

.tools-section {
  padding: 28px clamp(18px, 4vw, 56px) 42px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.search-wrap {
  width: min(420px, 100%);
}

.search-wrap input,
.control,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  padding: 0 14px;
}

textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.filter {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-weight: 800;
}

.filter.active {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.tool-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 166px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: left;
  box-shadow: 0 8px 28px rgba(16, 32, 51, 0.05);
  transition: transform 160ms ease, border-color 160ms ease;
}

.tool-card:hover {
  border-color: #8eb4ff;
  transform: translateY(-3px);
}

.tool-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue-dark);
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

.tool-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tag {
  display: inline-flex;
  margin-top: 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.info-band {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr);
  gap: 24px;
  padding: 46px clamp(18px, 4vw, 56px);
  background: #102033;
  color: var(--white);
}

.info-band p:last-child {
  margin: 0;
  color: #d8e2f0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 20, 36, 0.56);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  overflow: auto;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.icon-button {
  position: sticky;
  top: 12px;
  left: calc(100% - 50px);
  display: grid;
  width: 38px;
  height: 38px;
  margin: 12px 12px 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #eef3fa;
  color: var(--ink);
  font-weight: 800;
}

.tool-body {
  display: grid;
  gap: 18px;
  padding: 0 24px 26px;
}

.tool-page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 56px) 54px;
}

.tool-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 16px 42px rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

.tool-shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.back-link {
  color: var(--blue);
}

.tool-page-wrap .tool-body {
  padding: 22px;
}

.tool-page-hero {
  min-height: auto;
  display: block;
  padding: 46px clamp(18px, 4vw, 56px) 24px;
  text-align: center;
}

.tool-title-inner {
  max-width: 780px;
  margin: 0 auto;
}

.tool-page-hero h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.tool-page-hero .hero-text {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 18px;
}

.panel h3 {
  margin-bottom: 14px;
  color: var(--ink);
}

.controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.form-field,
.controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-field span {
  color: #43556d;
}

.form-field .control,
.form-field textarea,
.form-field select,
.form-field input {
  width: 100%;
}

.controls input[type="range"] {
  width: 100%;
}

.controls .button,
.controls a.button {
  width: 100%;
}

.result {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
  color: #27364a;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.invoice-tool {
  grid-template-columns: minmax(320px, 500px) minmax(0, 1fr);
}

.invoice-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.invoice-items {
  display: grid;
  gap: 10px;
}

.invoice-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 78px 104px 34px;
  gap: 8px;
  align-items: center;
}

.icon-mini {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.icon-mini:hover {
  border-color: #f2b8c6;
  color: #be123c;
}

.invoice-result {
  background: #f7fbff;
  overflow: auto;
}

.invoice-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.invoice-preview-doc {
  min-width: 560px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(16, 32, 51, 0.08);
}

.invoice-preview-doc header,
.invoice-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.invoice-preview-doc header {
  grid-template-columns: 1fr auto;
  margin-bottom: 20px;
}

.invoice-preview-doc h2 {
  font-size: 2rem;
}

.invoice-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.invoice-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-preview-doc table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
}

.invoice-preview-doc th,
.invoice-preview-doc td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.invoice-preview-doc th:nth-child(n+2),
.invoice-preview-doc td:nth-child(n+2) {
  text-align: right;
}

.invoice-totals {
  display: grid;
  gap: 8px;
  max-width: 290px;
  margin: 18px 0 0 auto;
}

.invoice-totals span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.invoice-total {
  padding-top: 10px;
  border-top: 2px solid var(--ink);
  color: var(--blue-dark);
  font-size: 1.2rem;
  font-weight: 800;
}

.invoice-notes {
  margin: 20px 0 0;
  color: var(--muted);
}

.tool-page-wrap .result {
  min-height: 300px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
}

.canvas-preview {
  display: grid;
  min-height: 320px;
  place-items: center;
  overflow: auto;
  color: var(--muted);
  text-align: center;
  position: relative;
}

.canvas-preview canvas,
.canvas-preview img {
  max-width: 100%;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.magic-preview {
  cursor: crosshair;
  user-select: none;
}

.magic-mask {
  position: absolute;
  display: block;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.signature-pad-wrap {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.signature-pad-wrap[hidden] {
  display: none;
}

#signaturePad {
  width: 100%;
  height: auto;
  border: 1px dashed #9eb3cf;
  border-radius: 8px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

.signature-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pdf-sign-result {
  min-height: 420px;
}

.pdf-sign-preview {
  display: grid;
  min-height: 360px;
  place-items: center;
  color: var(--muted);
}

.pdf-sign-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.pdf-sign-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.pdf-signature-box {
  position: absolute;
  z-index: 2;
  cursor: move;
  border: 1px dashed var(--blue);
  background: rgba(255, 255, 255, 0.72);
  padding: 2px;
  touch-action: none;
}

.pdf-signature-overlay {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.signature-resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--white);
  border-radius: 99px;
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(16, 32, 51, 0.22);
  cursor: nwse-resize;
}

.page-hero {
  display: block;
  min-height: auto;
  padding: 58px clamp(18px, 4vw, 56px) 28px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.10), rgba(255, 255, 255, 0.92) 58%),
    linear-gradient(180deg, #ffffff 0%, #eff7ff 100%);
}

.page-hero h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.page-hero .hero-text {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.page-content {
  display: grid;
  gap: 16px;
  width: min(920px, calc(100% - 36px));
  margin: 0 auto 56px;
  padding-top: 16px;
}

.content-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 10px 28px rgba(16, 32, 51, 0.06);
}

.content-card h2 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.content-card p {
  margin: 0 0 10px;
  color: #40536d;
  line-height: 1.75;
}

.content-card a {
  color: var(--blue);
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 820px) {
  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding-top: 10px;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .nav-links > a,
  .nav-group > a {
    min-height: 34px;
    padding: 0 9px;
    white-space: nowrap;
  }

  .nav-dropdown {
    display: none;
  }

  .hero,
  .section-heading,
  .info-band,
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .invoice-two,
  .invoice-row {
    grid-template-columns: 1fr;
  }

  .invoice-row .icon-mini {
    width: 100%;
  }

  .tool-page-wrap {
    padding: 18px 14px 42px;
  }

  .tool-page-wrap .tool-body {
    padding: 14px;
  }

  .tool-shell-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .result,
  .tool-page-wrap .result,
  .canvas-preview {
    min-height: 190px;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    margin-bottom: -12px;
  }

  .preview-grid,
  .stat-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .trust-strip {
    transform: none;
    margin-top: 18px;
  }
}

/* ============================================
   Styles patch v2
   Hero trust bar, mobile menu, footer,
   filter counts, no-results, performance tweaks
   ============================================ */

/* Hero trust badges */
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.hero-trust span {
  background: rgba(20,99,255,0.08);
  border: 1px solid rgba(20,99,255,0.18);
  color: var(--blue-dark);
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 6px;
}
.mobile-menu-btn:hover { background: var(--soft); }

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--blue);
  flex-direction: column;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(16,32,51,0.1);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 16px clamp(18px,4vw,56px);
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.mobile-menu a:hover { background: var(--soft); color: var(--blue); }

/* Filter counts */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0 5px;
  margin-left: 4px;
}
.filter:not(.active) .filter-count {
  background: var(--line);
  color: var(--muted);
}

/* No results message */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 1rem;
}

/* Better footer */
.footer-inner {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
  gap: 48px;
  padding: 48px clamp(18px,4vw,56px) 32px;
}
.footer-brand p {
  color: #8ca0b8;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 10px;
  max-width: 220px;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 24px;
}
.footer-links strong {
  display: block;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.footer-links a {
  display: block;
  color: #8ca0b8;
  font-size: 0.85rem;
  margin-bottom: 7px;
  transition: color 0.15s;
}
.footer-links a:hover { color: #60a5fa; }
.site-footer {
  background: #0c1929;
  color: #8ca0b8;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.site-footer > span,
.site-footer > nav {
  padding-left: clamp(18px,4vw,56px);
  padding-right: clamp(18px,4vw,56px);
}

.site-footer > span {
  padding-top: 24px;
  color: var(--white);
  font-weight: 800;
}

.site-footer > nav {
  padding-top: 10px;
  padding-bottom: 24px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px clamp(18px,4vw,56px);
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.8rem;
  color: #4a6480;
}

/* Tool card new badge */
.tool-card.new-tool::after {
  content: 'NEW';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--blue);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}
.tool-card { position: relative; }

/* Gradient Generator tool styles */
.gradient-preview {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
  transition: all 0.2s;
}
.gradient-code {
  background: #0c1929;
  color: #60a5fa;
  font-family: monospace;
  font-size: 0.82rem;
  padding: 12px 14px;
  border-radius: 8px;
  word-break: break-all;
  line-height: 1.6;
  margin-top: 10px;
}

/* Percentage & Timezone tool */
.calc-result-big {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue-dark);
  margin: 8px 0 4px;
}

/* Performance: reduce repaints */
.tool-card { will-change: transform; }
.modal-card { will-change: transform; }

/* Smooth scroll offset for sticky header */
:target { scroll-margin-top: 80px; }

/* Better focus for accessibility */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ============ RESPONSIVE UPGRADES ============ */
@media (max-width: 820px) {
  .mobile-menu-btn { display: block; }
  .site-header { position: relative; }

  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-links { grid-template-columns: repeat(2,1fr); }
  .footer-bottom { flex-direction: column; text-align: center; }

  .hero-trust { gap: 8px; }
  .hero-trust span { font-size: 0.75rem; padding: 4px 10px; }
}

@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
  .filter-count { display: none; }

  .tool-grid { grid-template-columns: 1fr; }

  h1 { font-size: 3rem; }
}

/* ============================================
   v3 PATCH — Button fixes + new tool styles
   ============================================ */

/* Fix: buttons inside .controls should NOT stretch full width */
.controls .button,
.controls a.button {
  width: auto;
  justify-self: start;
}

/* Fix: action-button class keeps natural width */
.action-button {
  width: auto !important;
  align-self: start;
}

/* Merge add-file label button */
.merge-add-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.merge-add-label:hover {
  background: var(--soft);
  border-color: var(--blue);
}

/* Merge file list items */
.merge-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.875rem;
}
.merge-file-name {
  flex: 1;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merge-file-size { color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
.merge-file-remove {
  background: #fee2e2;
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #dc2626;
  font-weight: 800;
  flex-shrink: 0;
}
.merge-file-remove:hover { background: #fecaca; }

/* Invoice preview */
#invoicePreview {
  font-family: Inter, Arial, sans-serif;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

/* Gradient preview box */
.gradient-preview-box {
  width: 100%;
  height: 140px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  transition: all 0.2s;
}
.gradient-code-box {
  background: #0c1929;
  color: #60a5fa;
  font-family: monospace;
  font-size: 0.82rem;
  padding: 12px 14px;
  border-radius: 8px;
  word-break: break-all;
  line-height: 1.6;
}

/* compress stats grid */
.compress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.compress-stat-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}
.compress-stat-box strong { display: block; font-size: 1.1rem; font-weight: 800; }
.compress-stat-box span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }

/* ── Shape-draw blur overlay ── */
#imagePreview {
  position: relative;
}
#imagePreview > div {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
#imagePreview canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
#imagePreview canvas[style*="position: absolute"] {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ── Photoshop-style crop box ── */
.crop-box {
  position: absolute;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  touch-action: none;
  box-sizing: border-box;
}
.crop-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 50%;
  touch-action: none;
}
.crop-handle-nw { top: -9px; left: -9px; cursor: nwse-resize; }
.crop-handle-ne { top: -9px; right: -9px; cursor: nesw-resize; }
.crop-handle-sw { bottom: -9px; left: -9px; cursor: nesw-resize; }
.crop-handle-se { bottom: -9px; right: -9px; cursor: nwse-resize; }
.crop-dims {
  position: absolute;
  top: -28px;
  left: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
