:root {
  --blue: #146bff;
  --blue-dark: #0758e7;
  --ink: #0b1425;
  --muted: #596984;
  --line: #e1e9f4;
  --card: #ffffff;
  --shadow: 0 14px 35px rgba(32, 70, 130, 0.075);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); font-family: "Inter", Arial, sans-serif; overflow-x: hidden; background: radial-gradient(circle at 70% 13%, #eff6ff 0, rgba(239,246,255,0) 28%), linear-gradient(180deg, #fff 0%, #f7faff 100%); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(20, 107, 255, 0.3); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 24px; height: 24px; }
.icon-sprite { position: absolute; overflow: hidden; width: 1px; height: 1px; }
.site-shell { width: min(1300px, calc(100% - 64px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.tool-header { position: relative; z-index: 20; height: 70px; border-bottom: 1px solid #e9eef5; background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 12px rgba(26, 56, 102, 0.025); }
.header-inner { display: flex; align-items: center; height: 100%; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.8px; }
.brand > span:last-child span { color: var(--blue); }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #247bff, #0951d6); box-shadow: 0 6px 14px rgba(18, 104, 246, 0.24); }
.brand-mark svg { width: 18px; height: 18px; }
.tool-nav { display: flex; align-items: center; gap: 34px; margin: 0 auto; font-size: 13px; font-weight: 600; }
.tool-nav a { display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s ease; }
.tool-nav a:hover { color: var(--blue); }
.nav-down { width: 14px; height: 14px; }
.header-tools { display: flex; align-items: center; gap: 18px; }
.header-search { position: relative; display: flex; align-items: center; width: 358px; height: 39px; color: #71809a; border: 1px solid #d9e2ee; border-radius: 8px; background: #fff; }
.header-search:focus-within { border-color: #8db7ff; box-shadow: 0 0 0 3px rgba(20,107,255,.08); }
.header-search input { width: 100%; height: 100%; padding: 0 39px 0 14px; color: var(--ink); font-size: 12px; border: 0; border-radius: inherit; outline: 0; background: transparent; }
.header-search input::placeholder { color: #78869d; }
.header-search svg { position: absolute; right: 13px; width: 18px; height: 18px; pointer-events: none; }
.login-button { min-width: 76px; height: 39px; padding: 0 16px; color: #fff; font-size: 12px; font-weight: 700; border: 0; border-radius: 7px; background: linear-gradient(135deg, #1d75fb, #105de8); box-shadow: 0 6px 13px rgba(18, 104, 246, .2); transition: filter 0.2s, transform 0.2s; }
.login-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.mobile-menu { display: none; place-items: center; width: 38px; height: 38px; color: var(--ink); border: 0; border-radius: 7px; background: #f1f5fb; }
.mobile-menu svg { width: 21px; height: 21px; }

.breadcrumb { display: flex; align-items: center; gap: 13px; min-height: 55px; padding-top: 12px; color: #6c7d97; font-size: 12px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb > svg { flex: 0 0 auto; width: 14px; height: 14px; color: #a1aec0; }
.breadcrumb a svg { width: 16px; height: 16px; }
.breadcrumb span[aria-current="page"] { color: #162137; font-weight: 600; }

.tool-badge { display: inline-flex; gap: 6px; margin: 0 0 16px; padding: 6px 11px; color: #0864f7; font-size: 10px; font-weight: 800; letter-spacing: 0.03em; border-radius: 30px; background: #edf4ff; }
.tool-badge span { opacity: 0.72; }

/* PNG to JPG Tool Specific Styles */
.png-hero {
  padding-top: 14px;
  padding-bottom: 34px;
}

.png-hero h1 {
  margin: 0;
  font-size: clamp(40px, 4.1vw, 57px);
  line-height: 1.03;
  letter-spacing: -2.8px;
}

.png-hero h1 strong {
  color: var(--blue);
}

.png-hero > p:last-of-type {
  max-width: 475px;
  margin: 19px 0 25px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.png-workspace {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 52px;
  align-items: start;
}

.png-upload-panel,
.png-settings {
  border: 1px solid #e8edf4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(32, 70, 130, 0.075);
  padding: 27px;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.card-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.heading-icon, .settings-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 41px;
  height: 41px;
  color: var(--blue);
  border-radius: 12px;
  background: #eaf3ff;
}

.heading-icon svg, .settings-icon svg {
  width: 23px;
  height: 23px;
}

.card-heading h2, .settings-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.55px;
}

.card-heading p, .settings-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.png-dropzone {
  border: 1.5px dashed #82b0ff;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: #f6f9ff;
  transition: border 0.2s, background 0.2s;
}

.png-dropzone:hover {
  border-color: var(--blue);
  background: #eef5ff;
}

.png-dropzone:focus-visible {
  outline: 3px solid rgba(20, 107, 255, 0.3);
  outline-offset: 3px;
}

.upload-symbol {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  color: var(--blue);
  border-radius: 12px;
  background: #edf4ff;
}

.upload-symbol svg {
  width: 28px;
  height: 28px;
}

.png-dropzone strong {
  display: block;
  font-size: 16px;
  margin: 0 0 4px;
  color: var(--ink);
  font-weight: 700;
}

.png-dropzone > span:not(.upload-symbol) {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.browse-button {
  display: inline-block;
  margin: 12px 0 0;
  background: linear-gradient(135deg, #1975ff, #0758e6);
  color: #fff;
  padding: 8px 16px;
  border: 0;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(25, 117, 255, 0.2);
  transition: filter 0.2s;
}

.browse-button:hover {
  filter: brightness(1.06);
}

.png-dropzone small {
  display: block;
  margin-top: 8px;
  color: #7a89a0;
  font-size: 11px;
}

.original-card {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #e8edf4;
}

.preview-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.preview-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.preview-label b {
  font-size: 10px;
  color: var(--blue);
  font-weight: 700;
}

.image-stage {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 16px;
  border: 1px solid #e8edf4;
  border-radius: 8px;
  background: #fbfcff;
  margin-bottom: 12px;
}

.image-stage img {
  max-width: 100%;
  max-height: 280px;
  display: block;
}

.result-stage {
  min-height: 220px;
  margin-bottom: 12px;
}

.new-image {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #d9e2ee;
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.new-image:hover {
  background: #f6f9ff;
}

.new-image svg {
  width: 16px;
  height: 16px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #f6f9ff;
  border: 1px solid #eef5ff;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--blue);
  margin-top: 2px;
}

.privacy-note b {
  color: var(--ink);
  font-weight: 600;
}

.upload-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.settings-fields {
  display: grid;
  gap: 24px;
  margin-bottom: 22px;
}

.quality-field {
  display: grid;
  gap: 8px;
}

.quality-field span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.quality-field b {
  color: var(--blue);
}

.quality-field input {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #e8edf4 0%, #82b0ff 100%);
  outline: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.quality-field input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 107, 255, 0.3);
}

.quality-field input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 0;
  box-shadow: 0 2px 8px rgba(20, 107, 255, 0.3);
}

.background-field {
  padding: 0;
  margin: 0;
  border: 0;
}

.background-field legend {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

.background-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.background-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: border 0.2s;
}

.background-swatch.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue);
}

.background-swatch.white { background: #ffffff; }
.background-swatch.cream { background: #fff6e5; }
.background-swatch.grey { background: #edf1f7; }
.background-swatch.blue { background: #e8f3ff; }

#custom-background {
  width: 36px;
  height: 36px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  cursor: pointer;
}

.png-convert-button, .download-jpg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  margin-bottom: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #1975ff, #0758e6);
  box-shadow: 0 8px 18px rgba(12, 96, 241, 0.16);
  cursor: pointer;
  transition: filter 0.2s;
}

.png-convert-button:hover:not(:disabled),
.download-jpg:hover {
  filter: brightness(1.06);
}

.png-convert-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.png-convert-button svg, .download-jpg svg {
  width: 16px;
  height: 16px;
}

.settings-help {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 12px;
  font-size: 11px;
  color: var(--muted);
  border-radius: 8px;
  background: #f6f9ff;
  border: 1px solid #eef5ff;
}

.settings-help svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--blue);
  margin-top: 2px;
}

.jpg-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e8edf4;
}

.ad-wrap {
  margin: 40px auto;
  padding: 20px;
  border: 1px solid #e8edf4;
  border-radius: 8px;
  background: #f6f9ff;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.png-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 34px 4px 31px;
}

.png-benefits article {
  display: flex;
  gap: 12px;
}

.png-benefits article > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--blue);
  border-radius: 50%;
  background: #edf4ff;
}

.png-benefits article > span svg {
  width: 22px;
  height: 22px;
}

.png-benefits b {
  display: block;
  margin: 1px 0 5px;
  font-size: 12px;
}

.png-benefits p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.explore-bar { display: flex; align-items: center; justify-content: space-between; margin: 17px auto 20px; padding: 18px 80px; border-radius: 12px; background: linear-gradient(105deg, #f0f6ff, #f6f9ff); }
.explore-bar > div { display: flex; align-items: center; gap: 12px; }
.explore-mark { display: grid; place-items: center; width: 31px; height: 31px; color: #fff; border-radius: 50%; background: linear-gradient(145deg, #3186ff, #0754df); }
.explore-mark svg { width: 21px; height: 21px; }
.explore-bar p { margin: 0; font-size: 12px; }
.explore-bar p span { color: var(--blue); }
.explore-bar small { display: block; margin-top: 5px; color: #6d7b91; font-size: 10px; }
.explore-bar a { display: inline-flex; align-items: center; gap: 12px; min-width: 229px; height: 39px; padding: 0 17px; color: #fff; font-size: 12px; font-weight: 700; border-radius: 7px; background: linear-gradient(135deg, #267bff, #0758e9); box-shadow: 0 8px 17px rgba(12, 96, 241, 0.16); }
.explore-bar a svg { width: 17px; height: 17px; margin-left: auto; }

.login-dialog { position: relative; width: min(380px, calc(100% - 36px)); padding: 31px; color: var(--ink); border: 0; border-radius: 15px; box-shadow: 0 20px 70px rgba(0, 15, 45, 0.25); }
.login-dialog::backdrop { background: rgba(2, 12, 27, 0.58); backdrop-filter: blur(3px); }
.login-dialog > button:first-child { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 33px; height: 33px; color: #53637b; border: 0; border-radius: 50%; background: #f2f6fc; }
.login-dialog > button:first-child svg { width: 17px; height: 17px; }
.dialog-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 15px; color: #fff; border-radius: 12px; background: var(--blue); }
.dialog-icon svg { width: 24px; height: 24px; }
.login-dialog h2 { margin: 0; font-size: 21px; }
.login-dialog p { margin: 10px 0 20px; color: var(--muted); font-size: 13px; }
.login-dialog > button:last-child { width: 100%; height: 42px; color: #fff; border: 0; border-radius: 7px; background: var(--blue); cursor: pointer; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 25px; max-width: calc(100% - 32px); padding: 12px 17px; color: #fff; font-size: 12px; border-radius: 8px; background: #10213b; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: 0.22s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1160px) {
  .png-workspace {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 1020px) {
  .tool-header { height: 65px; }
  .tool-nav { position: absolute; top: 64px; right: 0; left: 0; display: grid; gap: 0; max-height: 0; margin: 0; overflow: hidden; visibility: hidden; border-top: 1px solid #e4eaf3; background: #fff; box-shadow: 0 12px 22px rgba(31, 67, 119, 0.12); transition: max-height 0.25s, visibility 0.25s; }
  .tool-header.nav-open .tool-nav { max-height: 340px; visibility: visible; }
  .tool-nav a { padding: 14px 20px; border-bottom: 1px solid #edf1f6; }
  .tool-nav a:last-child { border: 0; }
  .header-tools { margin-left: auto; }
  .header-search { width: min(320px, 38vw); }
  .mobile-menu { display: grid; }
  .explore-bar { padding: 18px 30px; }
}

@media (max-width: 640px) {
  .png-workspace {
    gap: 26px;
  }

  .png-benefits {
    grid-template-columns: 1fr;
    gap: 19px;
    padding: 27px 3px;
  }

  .explore-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .explore-bar a {
    width: 100%;
    min-width: 0;
  }

  .png-dropzone {
    padding: 30px 16px;
  }

  .image-stage {
    min-height: 150px;
  }

  .png-upload-panel,
  .png-settings {
    padding: 20px;
  }
}

@media (max-width: 390px) {
  .login-button {
    display: none;
  }

  .png-workspace {
    gap: 20px;
  }
}
