* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

a {
  color: var(--action);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--action-hover);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text-strong);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner,
.page-shell,
.footer-inner {
  width: min(calc(100% - 64px), var(--content));
  margin-inline: auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav ul,
.mobile-nav ul,
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.category-nav-link:hover,
.category-nav-link[aria-current="page"] {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text-strong);
}

.category-nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
}

.category-nav-icon .app-icon-glyph {
  width: 17px;
  height: 17px;
}

.tone-blue .category-nav-icon,
.app-icon.tone-blue,
.related-app-icon.tone-blue {
  background: #2f65d5;
}

.tone-teal .category-nav-icon,
.app-icon.tone-teal,
.related-app-icon.tone-teal {
  background: #16857e;
}

.tone-violet .category-nav-icon,
.app-icon.tone-violet,
.related-app-icon.tone-violet {
  background: #7251a8;
}

.tone-orange .category-nav-icon,
.app-icon.tone-orange,
.related-app-icon.tone-orange {
  background: #c45f2a;
}

.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  min-width: 88px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text-strong);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.menu-grid-icon {
  width: 18px;
  height: 18px;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-nav {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface);
}

.mobile-nav ul {
  display: grid;
  gap: 0;
}

.mobile-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
}

.mobile-nav .category-nav-link {
  gap: 10px;
  border: 0;
}

.page-shell {
  flex: 1 0 auto;
  padding-block: 36px 64px;
}

.work-column,
.reading-column {
  min-width: 0;
  width: min(100%, var(--work));
  margin-inline: auto;
}

.tool-image-compressor .work-column {
  width: 100%;
}

.reading-column {
  max-width: 760px;
}

.breadcrumb {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--text-muted);
}

h1,
h2,
h3 {
  color: var(--text-strong);
  text-wrap: balance;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(32px, 3.6vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h2 {
  margin: 40px 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

p,
ul,
ol {
  margin-block: 0 16px;
}

.lede {
  max-width: 760px;
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

.compact-intro {
  margin: 6px 0 24px;
  color: var(--text-muted);
}

.muted,
.metadata {
  color: var(--text-muted);
}

.metadata {
  font-size: 13px;
}

.link-list {
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid var(--border);
}

.link-list a {
  min-height: 56px;
  display: grid;
  align-content: center;
  padding: 12px 6px;
  color: var(--text-strong);
  text-decoration: none;
}

.link-list a:hover .link-title {
  color: var(--action-hover);
  text-decoration: underline;
}

.link-title {
  color: var(--action);
  font-weight: 650;
}

.link-description {
  color: var(--text-muted);
  font-size: 14px;
}

.category-group + .category-group {
  margin-top: 32px;
}

.category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 0;
}

.plain-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.plain-section h2:first-child {
  margin-top: 0;
}

.home-page .work-column,
.category-page .work-column {
  width: min(100%, 1040px);
}

.tool-directory {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 32px 48px;
}

.tool-directory .category-group,
.tool-directory .category-group + .category-group {
  margin: 0;
}

.tool-directory h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.tool-directory h2 a {
  color: var(--text-muted);
  text-decoration: none;
}

.compact-links {
  margin-top: 0;
}

.compact-links a {
  min-height: 48px;
  padding-block: 8px;
}

.more-tools {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 13px;
}

.more-tools > span {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.more-tools ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-app {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: none;
}

.related-app:hover {
  border-color: var(--action);
}

.related-app-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
}

.related-app-icon .app-icon-glyph {
  width: 19px;
  height: 19px;
}

.page-details {
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.page-details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--text-strong);
  cursor: pointer;
  font-weight: 650;
}

.page-details-body {
  padding-bottom: 4px;
}

.page-details .method-list {
  margin-top: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.trust-list {
  margin-top: 20px;
  padding-left: 20px;
}

.trust-list li + li {
  margin-top: 8px;
}

.app-shell {
  min-width: 0;
}

.app-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.app-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.app-trust {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.app-search {
  position: relative;
  width: min(100%, 620px);
  margin-top: 16px;
}

.app-search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.app-search input[type="search"] {
  min-height: 52px;
  padding: 10px 44px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-strong);
  font: inherit;
  font-size: 16px;
}

.app-search input[type="search"]::-webkit-search-cancel-button {
  width: 18px;
  height: 18px;
}

.app-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.app-filter {
  min-height: 44px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.app-filter:hover,
.app-filter[aria-pressed="true"] {
  border-color: var(--text-strong);
  background: var(--text-strong);
  color: #fff;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px 18px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.app-grid-category {
  margin-top: 26px;
}

.app-item {
  min-width: 0;
}

.app-tile {
  min-height: 120px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 14px;
  color: var(--text-strong);
  text-align: center;
  text-decoration: none;
}

.app-tile:hover {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.app-icon {
  width: 64px;
  height: 64px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(0 0 0 / 8%);
  border-radius: 17px;
  color: #fff;
}

.app-icon-glyph {
  width: 34px;
  height: 34px;
}

.app-label {
  max-width: 150px;
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.app-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  margin: 24px 0 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.category-app-shell .breadcrumb {
  margin-bottom: 14px;
}

.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding-block: 16px max(24px, env(safe-area-inset-bottom));
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
  font-size: 14px;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 899px) {
  .tool-directory {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .app-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .site-header,
  .header-inner {
    min-height: 60px;
  }

  .header-inner,
  .page-shell,
  .footer-inner {
    width: calc(100% - 40px);
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .page-shell {
    padding-block: 20px 40px;
  }

  .app-heading {
    align-items: center;
  }

  .app-search {
    width: 100%;
    margin-top: 14px;
  }

  .app-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .app-filter {
    min-width: 0;
    padding-inline: 2px;
    font-size: 12px;
  }

  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 10px;
    margin-top: 22px;
  }

  .app-tile {
    min-height: 108px;
    gap: 8px;
    padding-inline: 2px;
  }

  .app-icon {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }

  .app-icon-glyph {
    width: 31px;
    height: 31px;
  }

  .app-label {
    max-width: 104px;
    font-size: 13px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.16;
  }

  h2 {
    margin-top: 32px;
    font-size: 22px;
  }

  .lede {
    margin: 6px 0 14px;
    font-size: 16px;
  }

  .category-heading,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner {
    min-height: 0;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 374px) {
  .header-inner,
  .page-shell,
  .footer-inner {
    width: calc(100% - 32px);
  }

  .wordmark {
    font-size: 17px;
  }

  .mobile-menu summary {
    min-width: 82px;
  }

  .app-grid {
    gap-inline: 6px;
  }

  .app-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  button,
  input,
  select,
  textarea {
    transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
  }
}

@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
  }
}
