.site-topbar-root {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: 'Libre Franklin', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.site-topbar-inner {
  width: min(1180px, 94vw);
  min-height: 44px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #0f172a;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-topbar-logo {
  display: block;
  height: 26px;
  width: auto;
}

.site-topbar-by {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.site-topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
}

.site-topbar-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #334155;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.site-topbar-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.site-topbar-cta {
  background: #2C7A7B;
  color: #fff;
}

.site-topbar-cta:hover {
  background: #1a5a5b;
  color: #fff;
}

.tools-page-sticky-nav .top-nav {
  position: sticky;
  top: 48px;
  z-index: 900;
  padding: 7px 0;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-free-tools-page .top-nav .top-link:first-child {
  gap: 7px;
  border-color: #2C7A7B;
  background: #2C7A7B;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(44, 122, 123, 0.22);
}

.site-free-tools-page .top-nav .top-link:first-child::before {
  content: '←';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.site-free-tools-page .top-nav .top-link:first-child:hover {
  border-color: #1f6869;
  background: #1f6869;
  color: #fff;
}

.tools-page-sticky-nav .top-nav .site-tools-signup-cta {
  margin-left: auto;
  border-color: #99f6e4;
  background: #ecfeff;
  color: #0f766e;
  font-weight: 900;
}

.tools-page-sticky-nav .top-nav .site-tools-signup-cta:hover {
  border-color: #2C7A7B;
  background: #2C7A7B;
  color: #fff;
}

@media (max-width: 640px) {
  .tools-page-sticky-nav .top-nav .site-tools-signup-cta {
    margin-left: 0;
  }
}

.site-scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: none;
  min-width: 42px;
  height: 34px;
  border: 1px solid #2C7A7B;
  border-radius: 999px;
  background: #2C7A7B;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.site-scroll-top-btn.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-converter-shell {
  --converter-card-height: 360px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto) minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  margin: 14px 0 10px;
  width: 100%;
  max-width: 100%;
}

.site-converter-card {
  min-width: 0;
  max-width: 100%;
  height: var(--converter-card-height);
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.site-converter-card-title {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  font-weight: 900 !important;
}

.site-converter-card textarea,
.site-converter-card .output,
.site-converter-card pre,
.site-converter-card code {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 0;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  min-width: 0 !important;
  resize: none !important;
  overflow: auto !important;
}

.site-converter-card .output,
.site-converter-card textarea[readonly] {
  overflow: auto;
  white-space: pre-wrap;
}

.site-converter-card input[type="text"],
.site-converter-card input:not([type]) {
  width: 100% !important;
  min-width: 0 !important;
}

.site-converter-card input,
.site-converter-card select,
.site-converter-card button,
.site-converter-card label {
  max-width: 100%;
}

.site-converter-card button,
.site-converter-middle button {
  white-space: normal;
  line-height: 1.2;
}

.site-converter-card .input-tools,
.site-converter-card .pubchem-import,
.site-converter-card .pdb-id-form {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.site-converter-card .input-tools {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  margin: 0 !important;
}

.site-converter-card .pubchem-import,
.site-converter-card .pdb-id-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 7px !important;
}

.site-converter-card .pubchem-import input,
.site-converter-card .pdb-id-form input {
  min-width: 0 !important;
  width: 100% !important;
}

.site-converter-card .file-picker {
  width: 100%;
  min-width: 0;
}

.site-sample-presets,
.site-converter-card .example-chips {
  display: flex;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}

.site-sample-presets button,
.site-converter-card .example-chips button {
  height: auto;
  min-height: 28px;
  border-color: #d1d5db;
  background: #fff;
  color: #334155;
  font-size: 11px;
  padding: 5px 10px;
}

.site-formula-mass-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px;
  padding: 8px;
  border: 1px solid #ccfbf1;
  border-radius: 12px;
  background: #f0fdfa;
}

.site-formula-mass-links span {
  color: #134e4a;
  font-size: 12px;
  font-weight: 900;
}

.site-formula-mass-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0 9px;
  background: #fff;
  color: #0f766e;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.site-converter-middle {
  min-width: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-converter-primary-action {
  min-width: 0;
  max-width: 120px;
  min-height: 40px;
  height: auto !important;
  padding: 10px 12px !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 22px rgba(44, 122, 123, 0.18);
}

.site-converter-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
  min-width: 0;
  max-width: 100%;
}

.site-converter-card-actions button {
  height: auto;
  min-height: 32px;
  flex: 0 1 auto;
}

.site-converter-enhanced > .actions,
.site-converter-enhanced .input-wrap:empty {
  display: none !important;
}

@media (max-width: 720px) {
  .site-topbar-inner {
    width: 100%;
    padding: 0 10px;
  }

  .site-topbar-by {
    display: none;
  }

  .site-topbar-link {
    font-size: 11px;
    padding: 0 8px;
  }

  .tools-page-sticky-nav .top-nav {
    top: 44px;
  }

  .site-converter-shell {
    --converter-card-height: 320px;
    grid-template-columns: 1fr !important;
  }

  .site-converter-middle {
    min-width: 0;
  }

  .site-converter-primary-action {
    width: 100%;
    max-width: 100%;
  }

  .site-converter-card .pubchem-import,
  .site-converter-card .pdb-id-form {
    grid-template-columns: 1fr !important;
  }

  .site-converter-card-actions button {
    flex: 1 1 140px;
  }
}

@media (max-width: 560px) {
  .site-topbar-root {
    position: sticky;
  }

  .site-topbar-inner {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 7px 10px 8px;
  }

  .site-topbar-brand {
    max-width: 100%;
  }

  .site-topbar-logo {
    height: 23px;
  }

  .site-topbar-nav {
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .site-topbar-link {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 10px;
  }

  .tools-page-sticky-nav .top-nav {
    top: 86px;
  }

  .site-scroll-top-btn {
    right: 12px;
    bottom: 12px;
  }

  .container,
  .page,
  .page-wrap,
  .content,
  .main,
  .shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .top-nav,
  .tabs,
  .actions,
  .nav,
  .modal-actions {
    flex-wrap: wrap;
  }

  .panel,
  .hero,
  .card,
  .chapter-card,
  .blog-card,
  .tool-card {
    max-width: 100%;
  }

  h1,
  h2,
  h3,
  p,
  a,
  li,
  button,
  input,
  textarea,
  select {
    overflow-wrap: anywhere;
  }

  input,
  textarea,
  select,
  button {
    font-size: 16px;
  }

  img,
  svg,
  canvas,
  iframe,
  video {
    max-width: 100%;
  }

  pre,
  code,
  table,
  .output,
  .result,
  .preview,
  .code-block {
    max-width: 100%;
    overflow-x: auto;
  }
}
