html,
body {
  margin: 0;
  background: #fff;
}

.header-row {
  position: sticky;
  top: 16px;
  z-index: 50;
  margin: 16px;
  padding: 6px 6px 6px 20px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  background: #bfffbf;
}

.top-actions {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-title {
  font-family: "Roboto Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: #222222;
}

.top-title-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-buttons {
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
}

.support-button {
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: #1f1f1f;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.support-button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.icon-button {
  width: 48px;
  height: 48px;
  margin-left: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.7);
}

.copy-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.top-buttons > * + * {
  margin-left: 8px;
}

.icon-button img {
  width: 20px;
  height: 20px;
}

.image-wrap {
  padding: 0 16px 16px;
}

#mainImage {
  display: block;
  width: 100%;
  height: auto;
}

#downloadImageBtn {
  width: auto;
  padding: 0 16px;
  gap: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  color: #111111;
}

.copy-button {
  width: auto;
  padding: 0 16px;
  margin-left: 0;
  gap: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  color: #111111;
}

.copy-toast {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 20;
  padding: 10px 14px;
  width: fit-content;
  border-radius: 12px;
  background: #bfffbf;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: #111111;
  opacity: 0;
  transform: translate(-50%, -2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.copy-toast img {
  width: 20px;
  height: 20px;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow-x: hidden;
  }


  #zoomContainer {
    touch-action: none;
    width: fit-content;
    flex-shrink: 0;
  }

  .header-row {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
  }

  .top-actions {
    order: 1;
    flex: initial;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .image-wrap {
    order: 2;
  
    flex: 1;
  
    overflow: auto;
  
    padding: 0 12px 72px;
  
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .support-button {
    order: 3;
  }

  .top-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  
    width: 100%;
    margin: 0 0 8px;
    padding: 8px 12px;
  
    box-sizing: border-box;
  
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
  
    font-size: 13px;
  }

  

  .top-title > div:first-child {
    text-align: left;
  }

  .support-button,
  .copy-button,
  #downloadImageBtn,
  .copy-toast {
    font-size: 15px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .copy-button,
  #downloadImageBtn {
    width: auto;
    height: 36px;
  }

  .top-title-meta {
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
    text-align: right;
    white-space: nowrap;
  }

  .copy-toast {
    position: fixed !important;
  
    top: 88px !important;
    left: 12px !important;
    right: 12px !important;
  
    width: auto !important;
  
    z-index: 99999 !important;
  
    display: flex;
    justify-content: center;
    align-items: center;
  
    margin: 0 !important;
  
    transform: none !important;
  
    box-sizing: border-box;
  }

  .copy-toast.is-visible {
    transform: translateY(-50%);
  }

  .top-buttons {
    margin: 0 12px 16px;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    background: #f2f2f2;
    border-radius: 12px;
    overflow: hidden;
    min-height: 36px;
  }

  .top-buttons > * + * {
    margin-left: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
  }

  .top-buttons > .copy-wrap {
    min-width: 0;
    display: flex;
    align-self: stretch;
  }

  .top-buttons > #downloadImageBtn {
    min-width: 0;
    align-self: stretch;
  }

  .top-buttons .icon-button {
    background: transparent;
    box-sizing: border-box;
    margin-left: 0;
    border-radius: 0;
  }

  .top-buttons .copy-button,
  .top-buttons #downloadImageBtn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
  }

  .top-buttons .icon-button:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .top-buttons .copy-button:active,
  .top-buttons #downloadImageBtn:active {
    background: rgba(0, 0, 0, 0.08);
  }

  .support-button {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
  
    width: auto;
    height: 48px;
  
    margin: 0;
  
    justify-content: center;
    box-sizing: border-box;
  
    background: #bfffbf;
    color: #111111;
  
    z-index: 30;
  }

  .support-button img {
    filter: brightness(0);
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline;
  }
}
