:root {
  color-scheme: dark;
  --page: #191a1c;
  --ink: #f4f4f6;
  --muted: #a2a5ad;
  --line: #35363c;
  --accent: #b7caff;
  --telegram: #229ed9;
  --banner-height: 0px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  --safe-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-safe-area-inset-top, 0px)
  );
  --safe-bottom: max(
    env(safe-area-inset-bottom, 0px),
    var(--tg-safe-area-inset-bottom, 0px)
  );
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
}
* {
  box-sizing: border-box;
}
body {
  --chrome-top: calc(
    var(--safe-top) + var(--content-top) + var(--banner-height)
  );
  margin: 0;
  background: var(--page);
  color: var(--ink);
  min-height: 100dvh;
  padding-top: var(--chrome-top);
  padding-bottom: calc(
    var(--safe-bottom) + var(--tg-content-safe-area-inset-bottom, 0px)
  );
  -webkit-font-smoothing: antialiased;
}
body.has-preview-banner {
  --banner-height: 80px;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button svg,
a svg {
  pointer-events: none;
}
svg {
  display: block;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.app-layout {
  display: flex;
  min-height: calc(
    100dvh - var(--safe-top) - var(--content-top) - var(--banner-height)
  );
}
.sidebar {
  position: sticky;
  top: var(--chrome-top);
  height: calc(100dvh - var(--chrome-top));
  align-self: flex-start;
  overflow-y: auto;
  z-index: 20;
  flex: none;
  width: 198px;
  border-right: 1px solid #2b2c31;
  padding: 24px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  background: #18191b;
}
.side-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.15px;
  color: #999da6;
  transition:
    background 0.18s,
    color 0.18s;
}
.side-button svg {
  width: 21px;
  height: 21px;
  flex: none;
}
.side-button:hover {
  background: #25262a;
  color: #eaeaf0;
}
.side-button.active {
  background: #2b2d32;
  color: #f7f7fa;
  border-color: #36383e;
}
.side-button.active svg {
  color: #bccfff;
}
main {
  width: 100%;
  min-width: 0;
  padding: 24px 10px 36px;
}
.catalog-controls {
  position: sticky;
  top: var(--chrome-top);
  z-index: 30;
  margin: -24px -10px 0;
  padding: 24px 10px 28px;
  isolation: isolate;
}
.catalog-controls::before {
  content: "";
  position: absolute;
  /* Cover Telegram's fullscreen chrome while controls keep their safe inset. */
  inset: calc(-1 * var(--chrome-top)) 0 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, #191a1ce6, #191a1cd6 70%, #191a1ce0);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), #0000);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), #0000);
}
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.filter {
  display: block;
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #a6a8b0;
  font-size: 15px;
  letter-spacing: -0.2px;
  font-weight: 500;
  transition:
    background 0.18s,
    color 0.18s;
}
.filter:hover {
  background: #27282d;
  color: #fafafa;
}
.filter.active {
  background: #ededf0;
  color: #1b1c20;
  border-color: #fff1;
  box-shadow: 0 2px 5px #0002;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.search-wrap {
  width: 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #373940;
  border-radius: 14px;
  padding: 0 13px;
  height: 44px;
  background: #212226;
  color: #8d929c;
  transition: border-color 0.18s;
}
.search-wrap:focus-within {
  border-color: #8e9fca;
}
.search-wrap svg {
  width: 19px;
  height: 19px;
  flex: none;
}
.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #eee;
  /* Smaller input text triggers automatic focus zoom in iOS WebViews. */
  font-size: 16px;
  outline: 0;
}
.search-wrap input::placeholder {
  color: #8d929c;
}
.fullscreen-button {
  width: 44px;
  height: 44px;
  border: 1px solid #373940;
  background: #212226;
  border-radius: 13px;
  padding: 11px;
  flex: none;
}
.fullscreen-button svg {
  height: 20px;
  width: 20px;
}
.preview-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--telegram);
  color: #fff;
  text-decoration: none;
}
.preview-banner.is-linked {
  cursor: pointer;
}
.preview-banner.is-linked:hover .banner-link {
  background: #eaf6ff;
}
.banner-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  color: #fff;
}
.banner-symbol svg {
  width: 34px;
  height: 34px;
}
.banner-copy {
  flex: 1;
  min-width: 0;
}
.banner-copy h2 {
  margin: 0 0 5px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.45px;
  font-weight: 600;
}
.banner-copy p {
  margin: 0;
  color: #ffffffdb;
  font-size: 14px;
  line-height: 1.4;
}
.banner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  background: #fff;
  color: #147db0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.18s;
}
.banner-link:hover {
  background: #eaf6ff;
}
.banner-link svg {
  width: 17px;
  height: 17px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  padding: 24px;
  border: 1px solid #3b3e46;
  border-radius: 26px;
  background: linear-gradient(128deg, #2c303a 0%, #25272d 64%, #25262b 100%);
  box-shadow: 0 5px 15px #0000000b;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.22s,
    box-shadow 0.22s;
}
.tool-card[data-tool="heic_jpg"] {
  background: linear-gradient(128deg, #312f3a 0%, #28272e 64%, #27262b 100%);
}
.tool-card[data-tool="compress_image"] {
  background: linear-gradient(128deg, #34302c 0%, #2b2929 64%, #292729 100%);
}
.tool-card[data-tool="clean_url"] {
  background: linear-gradient(128deg, #29332f 0%, #252b2a 64%, #25292a 100%);
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: #626774;
  box-shadow:
    0 14px 30px #0002,
    0 1px 0 #ffffff08 inset;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 42px 14px 0;
  min-height: 102px;
}
.tool-illustration {
  display: block;
  width: 102px;
  height: 102px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 6px 8px #0002);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  user-select: none;
}
.tool-card:hover .tool-illustration {
  transform: translateY(-2px) rotate(-2deg);
}
.card-heading {
  min-width: 0;
}
.card-category {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  line-height: 1.4;
  color: #a8aab5;
  margin: 0 0 8px;
}
.card-heading h2 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.7px;
  font-weight: 600;
  margin: 0;
}
.card-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.1px;
  color: #b9bbc4;
  margin: 0 0 24px;
  max-width: 470px;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}
.bookmark-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9297a3;
  transition: color 0.18s;
}
.bookmark-button svg {
  width: 26px;
  height: 28px;
}
.bookmark-button:hover {
  background: transparent;
  color: #f2f5ff;
}
.bookmark-button[aria-pressed="true"] {
  color: #c8d6ff;
  background: transparent;
}
.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #a1a5b1;
  font-size: 14px;
  transition:
    color 0.18s,
    background 0.18s;
}
.share-button svg {
  width: 19px;
  height: 19px;
}
.share-button:hover {
  color: #f1f1f5;
}
.card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #f4f4f3;
  border-radius: 13px;
  background: #ededed;
  color: #222329;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
  box-shadow: 0 2px 3px #0001;
  transition:
    background 0.18s,
    box-shadow 0.18s;
}
.card-link svg {
  height: 18px;
  width: 18px;
}
.card-link:hover {
  background: #fff;
  box-shadow: 0 5px 12px #0002;
}
.empty {
  padding: 36px 10px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: #b0b4bf;
}
.mobile-views {
  display: none;
}
.status {
  position: fixed;
  left: 50%;
  bottom: calc(
    16px + var(--safe-bottom) + var(--tg-content-safe-area-inset-bottom, 0px)
  );
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 14px 12px 14px 18px;
  margin: 0;
  transform: translateX(-50%);
  border: 1px solid #50535f;
  border-radius: 17px;
  background: #30323a;
  color: #f3f4fa;
  box-shadow: 0 12px 36px #0005;
  font-size: 14px;
  line-height: 1.5;
  animation: toast-in 0.18s ease-out;
}
#status-message {
  min-width: 0;
  max-width: 390px;
}
#status-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b7bcc9;
}
#status-close:hover {
  background: #ffffff0b;
  color: #fff;
}
#status-close svg {
  width: 20px;
  height: 20px;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
#preview-illustration {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: -4px 0 20px;
}
dialog {
  width: min(480px, calc(100% - 24px));
  padding: 30px;
  border: 1px solid #494c56;
  border-radius: 26px;
  background: #25272d;
  color: var(--ink);
  box-shadow: 0 30px 90px #0006;
}
dialog::backdrop {
  background: #0b0c10b8;
  backdrop-filter: blur(8px);
}
dialog h2 {
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -0.9px;
  font-weight: 600;
  margin: 22px 0 18px;
}
dialog p {
  font-size: 16px;
  line-height: 1.7;
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #a4a8b3;
}
.dialog-close:hover {
  background: #ffffff0c;
}
.dialog-close svg {
  width: 21px;
  height: 21px;
}
.preview-note {
  color: #a4a9b6;
  font-size: 14px !important;
}
.primary-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 48px;
  margin-top: 24px;
  border-radius: 13px;
  background: #ededf0;
  color: #202228;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.primary-link:hover {
  background: #fff;
}
.primary-link svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 1100px) {
  .sidebar {
    width: 76px;
    padding: 24px 10px;
  }
  .side-button {
    justify-content: center;
    padding: 0;
  }
  .side-button span {
    display: none;
  }
  .side-button svg {
    width: 22px;
    height: 22px;
  }
  .tool-card {
    padding: 21px;
    min-height: 280px;
  }
  .card-top {
    gap: 16px;
    margin-right: 36px;
  }
  .tool-illustration {
    width: 94px;
    height: 94px;
  }
  .card-heading h2 {
    font-size: 24px;
  }
  .card-description {
    font-size: 15px;
  }
}
@media (min-width: 761px) and (max-width: 900px) {
  .card-top {
    gap: 12px;
    margin-right: 30px;
  }
  .tool-illustration {
    width: 84px;
    height: 84px;
  }
  .card-heading h2 {
    font-size: 22px;
    white-space: nowrap;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  main {
    padding: 18px 10px 28px;
  }
  .catalog-controls {
    margin: -18px -10px 0;
    padding: 18px 0 28px;
  }
  .mobile-views {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 clamp(14px, 5vw, 28px);
    margin: 0 0 14px;
    border-bottom: 1px solid #33353b;
    overflow: visible;
  }
  .mobile-views button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    flex: none;
    min-height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9298a6;
    font-size: clamp(12px, 3.25vw, 14px);
    font-weight: 500;
    white-space: nowrap;
  }
  .mobile-views button.active {
    color: #f3f3f5;
  }
  .mobile-views button svg {
    width: 18px;
    height: 18px;
    flex: none;
  }
  .mobile-views button::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: transparent;
  }
  .mobile-views button.active::after {
    background: #f3f3f5;
  }
  .catalog-toolbar {
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 10px;
  }
  .filters {
    order: 2;
    flex-basis: 100%;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filter {
    flex: none;
    min-height: 42px;
    padding: 0 15px;
    font-size: 14px;
    border-radius: 12px;
  }
  .toolbar-actions {
    width: 100%;
  }
  .search-wrap {
    width: 100%;
    height: 42px;
  }
  .fullscreen-button {
    height: 42px;
    width: 42px;
    padding: 10px;
  }
  .preview-banner {
    padding: 12px 10px;
    gap: 10px;
  }
  .banner-symbol {
    width: 28px;
    height: 28px;
  }
  .banner-symbol svg {
    width: 28px;
    height: 28px;
  }
  .banner-copy h2 {
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin: 0;
  }
  .banner-copy p {
    display: none;
  }
  .banner-link {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    gap: 8px;
    font-size: 13px;
  }
  .banner-link svg {
    width: 16px;
    height: 16px;
  }
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .tool-card {
    padding: 16px 12px 12px;
    border-radius: 22px;
    min-height: 285px;
  }
  .card-top {
    display: block;
    margin: 0 0 12px;
    min-height: 0;
  }
  .tool-illustration {
    width: 80px;
    height: 84px;
    margin: 0 0 10px -2px;
  }
  .card-category {
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 6px;
  }
  .card-heading h2 {
    font-size: clamp(16px, 4.6vw, 20px);
    line-height: 1.25;
    letter-spacing: -0.5px;
    white-space: nowrap;
  }
  .card-description {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    max-width: none;
  }
  .bookmark-button {
    top: 7px;
    right: 6px;
    width: 40px;
    height: 40px;
    padding: 6px;
  }
  .bookmark-button svg {
    width: 26px;
    height: 28px;
  }
  .card-bottom {
    gap: 8px;
  }
  .share-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex: none;
    padding: 0;
    border: 1px solid #50535f;
    border-radius: 12px;
    background: #ffffff05;
    color: #c9cdd7;
  }
  .share-button:hover {
    background: #ffffff0b;
    color: #fff;
  }
  .share-button > span {
    display: none;
  }
  .share-button svg {
    width: 19px;
    height: 19px;
  }
  .card-link {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 12px;
    gap: 0;
  }
  .card-link > span {
    display: none;
  }
  .status {
    font-size: 14px;
  }
  .empty {
    font-size: 15px;
    padding: 30px 10px;
  }
  dialog {
    padding: 26px;
  }
  dialog h2 {
    font-size: 27px;
  }
}
@media (max-width: 360px) {
  .mobile-views {
    gap: 10px;
  }
  .mobile-views button {
    font-size: 12px;
    gap: 5px;
  }
  .mobile-views button svg {
    width: 16px;
    height: 16px;
  }
  .filter {
    font-size: 13px;
    padding: 0 12px;
  }
  .tool-card {
    border-radius: 20px;
  }
  .banner-copy h2 {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .tool-card:hover,
  .tool-card:hover .tool-illustration {
    transform: none;
  }
}
