:root {
  --fc-ink: #1b263c;
  --fc-muted: #68758b;
  --fc-line: #dfe5ef;
  --fc-violet: #5f46cb;
  --fc-paper: #f5f7fb;
  --fc-z-header: 1000;
  --fc-z-menu: 1010;
  --fc-header-height: 74px;
}

body {
  color: var(--fc-ink);
  background: var(--fc-paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

site-header {
  display: block;
  min-height: 75px;
}

.global-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: var(--fc-z-header);
  background: #fff;
  border-bottom: 1px solid var(--fc-line);
  box-shadow: 0 5px 18px rgba(26, 39, 63, .06);
}

.global-nav {
  display: flex;
  height: 74px;
  min-height: 74px;
  align-items: center;
  gap: 1.6rem;
}

.global-brand {
  display: block;
  flex: 0 0 220px;
}

.global-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.global-nav-links {
  display: flex;
  height: 100%;
  flex: 1;
  align-items: stretch;
  gap: 1.3rem;
}

.global-nav-links a {
  color: #344158;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}

.global-nav-links a:hover {
  color: var(--fc-violet);
}

.global-nav-links > .site-nav-link {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.global-nav-links > .account-signup {
  align-self: center;
  min-height: 38px;
  justify-content: center;
  padding: .45rem .8rem;
  border-radius: 9px;
  background: var(--fc-violet);
  color: #fff;
}

.global-nav-links > .account-signup:hover,
.global-nav-links > .account-signup[aria-current="page"] {
  background: #4d36b2;
  color: #fff;
}

.global-nav-links > a[aria-current="page"],
.pdf-mega-menu > summary[aria-current="page"] {
  color: var(--fc-violet);
}

.global-nav-links a:focus-visible,
.pdf-mega-menu > summary:focus-visible,
.pdf-mega-category > summary:focus-visible {
  outline: 2px solid var(--fc-violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.pdf-mega-menu {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
}

.pdf-mega-menu > summary {
  padding: .35rem .1rem;
  color: #344158;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.pdf-mega-menu > summary::-webkit-details-marker,
.pdf-mega-category > summary::-webkit-details-marker {
  display: none;
}

.pdf-mega-menu > summary::after {
  display: inline-block;
  margin-left: .4rem;
  color: var(--fc-muted);
  content: "⌄";
}

.pdf-mega-menu > summary[aria-expanded="true"]::after {
  content: "⌃";
}

.pdf-mega-menu[open] > summary {
  color: var(--fc-violet);
}

.pdf-mega-panel {
  position: fixed;
  z-index: var(--fc-z-menu);
  top: var(--fc-header-height);
  left: 50%;
  width: min(1040px, calc(100vw - 2rem));
  max-height: min(78vh, 700px);
  overflow: auto;
  padding: 1rem;
  transform: translateX(-50%);
  border: 1px solid var(--fc-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(26, 39, 63, .16);
  animation: menu-appear .12s ease-out both;
}

@keyframes menu-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pdf-mega-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .75rem;
  color: var(--fc-ink);
  font-size: .87rem;
  font-weight: 800;
}

.pdf-mega-heading a {
  color: var(--fc-violet);
  font-size: .78rem;
}

.pdf-menu-search {
  width: 100%;
  margin-bottom: .85rem;
  padding: .6rem .75rem;
  border: 1px solid var(--fc-line);
  border-radius: 9px;
  font-size: .84rem;
}

.pdf-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem .75rem;
}

.pdf-mega-category {
  min-width: 0;
}

.pdf-mega-category > summary {
  margin-bottom: .35rem;
  color: #344158;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .04em;
  list-style: none;
  text-transform: uppercase;
}

.pdf-mega-links {
  display: grid;
  gap: .16rem;
}

.pdf-mega-links a {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .38rem;
  border-radius: 6px;
  color: #59677e;
  font-size: .78rem;
  font-weight: 550;
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease;
}

.pdf-mega-links a:hover {
  background: #f3f1fb;
  color: var(--fc-violet);
}

.pdf-mega-links a i {
  width: 1rem;
  color: #8792a7;
  font-size: .82rem;
  text-align: center;
}

.pdf-mega-links a:hover i {
  color: var(--fc-violet);
}

.image-mega-menu .pdf-mega-panel {
  width: min(1080px, calc(100vw - 2rem));
}

.image-mega-menu .pdf-mega-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.other-mega-menu .pdf-mega-panel {
  width: min(560px, calc(100vw - 2rem));
}

.other-mega-menu .pdf-mega-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.pdf-mega-links a[hidden],
.pdf-mega-category[hidden] {
  display: none;
}

.global-search {
  display: flex;
  width: 220px;
  overflow: hidden;
  align-items: center;
  border: 1px solid var(--fc-line);
  border-radius: 11px;
  background: #fff;
}

.global-search input {
  width: 100%;
  min-width: 0;
  padding: .58rem .7rem;
  border: 0;
  outline: 0;
  font-size: .84rem;
}

.global-search button {
  align-self: stretch;
  padding: 0 .8rem;
  border: 0;
  background: #f2f0fb;
  color: var(--fc-violet);
  font-size: 1.1rem;
}

.global-menu-toggle {
  display: none;
  width: 42px;
  height: 40px;
  padding: .55rem;
  border: 1px solid var(--fc-line);
  border-radius: 9px;
  background: #fff;
}

.global-menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 3px;
  background: var(--fc-ink);
}

.converter-breadcrumb {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding-top: 1.25rem;
  padding-bottom: .6rem;
  color: #8a94a5;
  font-size: .78rem;
}

.converter-breadcrumb a {
  color: #59677e;
  text-decoration: none;
}

.converter-breadcrumb a:hover {
  color: var(--fc-violet);
}

.content-page {
  min-height: 0;
  padding: 1.25rem 0 4rem;
}

.content-page > .container,
.pair-page-info {
  max-width: 1140px;
}

.content-page h1 {
  max-width: 900px;
  margin: .5rem 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 820;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.content-page .page-intro {
  max-width: 750px;
  margin: .6rem 0 1.3rem;
  font-size: 1rem;
}

.content-page h2 {
  margin-top: 2rem;
  font-size: 1.3rem;
}

.content-page h2:not(#pairConverter h2) {
  letter-spacing: -.025em;
}

.content-page > div > h2,
.content-page > div > p:not(.page-intro) {
  max-width: 850px;
}

site-footer {
  display: block;
}

.site-footer {
  display: block;
  width: 100%;
  margin-top: 70px;
  padding: 3.25rem 0 0;
  background-color: #1E2E47 !important;
  background-image: none !important;
  color: #e7eaf0;
}

.footer-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) repeat(4, minmax(0, 1fr));
  gap: 2rem;
}

.footer-brand-link {
  display: inline-block;
  padding: .3rem .55rem;
  border-radius: 9px;
  
}

.footer-brand .brand-logo {
  display: block;
  width: 205px;
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: 0.8em;
  padding-left: 12px;
}

.footer-brand p {
  max-width: 265px;
  margin: 1.15rem 0 0;
  color: #c4cedc;
  font-size: .88rem;
  line-height: 1.65;
}

.footer-section h2 {
  margin: 0 0 .9rem;
  color: #fff;
  font-size: .9rem;
  font-weight: 800;
}

.site-footer .footer-section a:not(.navbar-brand):not(.social) {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: .58rem 0;
  color: #d5d2e8;
  font-size: .84rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color .16s ease;
}

.site-footer .footer-section a:not(.navbar-brand):not(.social):hover,
.site-footer .footer-legal a:not(.navbar-brand):not(.social):hover {
  color: #fff;
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .55rem 1.5rem;
  margin-top: 2.5rem;
  padding: 1.15rem 0 1.3rem;
  border-top: 1px solid rgba(218, 211, 255, .24);
}

.footer-bottom p {
  margin: 0;
  color: #c4c0d8;
  font-size: .8rem;
}

.footer-bottom .footer-note {
  grid-column: 1;
  color: #aebbd0;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-content: flex-end;
  gap: .5rem 1.15rem;
}

.site-footer .footer-legal a:not(.navbar-brand):not(.social) {
  display: inline;
  margin: 0;
  color: #d5d2e8;
  font-size: .8rem;
  text-decoration: none;
  transition: color .16s ease;
}

.site-footer .footer-legal a:focus-visible,
.site-footer .footer-section a:focus-visible,
.site-footer .footer-brand-link:focus-visible {
  outline: 2px solid #b8f5d4;
  outline-offset: 3px;
  border-radius: 4px;
}

.footer-note {
  color: #c4c0d8;
}

.pair-converter {
  max-width: 100%;
  margin: 1.5rem 0 2rem !important;
  padding: clamp(1.1rem, 3vw, 2rem) !important;
  border-color: #e0e5ee !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 32px rgba(26, 39, 63, .07) !important;
}

.pair-converter:focus-within {
  outline: 0;
}

.pair-converter .pair-overline {
  color: var(--fc-violet) !important;
}

.pair-upload {
  background: #f8f9fc !important;
  border-color: #aeb8ca !important;
}

.pair-upload-icon {
  background: #eeecf8 !important;
  color: var(--fc-violet) !important;
}

.pair-converter .btn-primary {
  border-color: var(--fc-violet) !important;
  background: var(--fc-violet) !important;
}

.pair-converter .pair-progress .progress-bar {
  background: var(--fc-violet);
}

.pair-advanced {
  margin: 1.2rem 0;
  border: 1px solid var(--fc-line);
  border-radius: 12px;
  background: #fff;
}

.pair-advanced summary {
  padding: .85rem 1rem;
  color: #344158;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 800;
  list-style: none;
}

.pair-advanced summary::-webkit-details-marker {
  display: none;
}

.pair-advanced summary::after {
  float: right;
  color: var(--fc-violet);
  content: "+";
  font-size: 1.15rem;
}

.pair-advanced[open] summary::after {
  content: "−";
}

.pair-advanced-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #edf0f5;
}

.pair-setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  padding-top: 1rem;
}

.pair-setting {
  display: grid;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 750;
}

.pair-setting input,
.pair-setting select {
  width: 100%;
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: var(--fc-ink);
  font: inherit;
}

.pair-setting input[type="range"] {
  padding: 0;
  accent-color: var(--fc-violet);
}

.pair-setting input[type="color"] {
  height: 40px;
  padding: 3px;
}

.pair-setting-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding-top: .8rem;
  font-size: .82rem;
  font-weight: 650;
}

.pair-setting-check input {
  accent-color: var(--fc-violet);
}

.pair-source-tabs {
  display: flex;
  width: max-content;
  gap: .4rem;
  margin-top: 1.1rem;
  padding: .3rem;
  border-radius: 10px;
  background: #eeeff4;
}

.pair-source-tab {
  padding: .4rem .8rem;
  border-radius: 7px;
  color: #59677e;
  font-size: .8rem;
  font-weight: 750;
}

.pair-source-tab.active {
  background: #fff;
  color: var(--fc-violet);
  box-shadow: 0 1px 4px #2632481c;
}

.pair-file-note {
  color: var(--fc-muted) !important;
}

.pair-card-info {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid #e2e6ee;
  border-radius: 12px;
  background: #fff;
  color: #66738a;
  font-size: .84rem;
}

.pair-card-info strong {
  color: var(--fc-ink);
}

.pair-page-info {
  padding-bottom: 3rem;
}

.pair-page-info .pair-card-info {
  margin: 0;
  padding: 1.4rem 1.6rem;
}

.pair-page-info h2 {
  margin: 1rem 0 .7rem;
  color: var(--fc-ink);
  font-size: 1.25rem;
}

.pair-page-info h2:first-child {
  margin-top: 0;
}

.pair-page-info ol {
  padding-left: 1.2rem;
}

.pair-page-info li {
  margin: .4rem 0;
}

.pair-page-info details {
  padding: .65rem 0;
  border-top: 1px solid var(--fc-line);
}

.pair-page-info details summary {
  color: #344158;
  cursor: pointer;
  font-weight: 750;
}

.pair-page-info details p {
  margin: .55rem 0 0;
  color: var(--fc-muted);
}

.tool-empty {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 2px dashed #aeb8ca;
  border-radius: 15px;
  background: #f8f9fc;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background-color .15s;
}

.tool-empty.drag-active,
.tool-empty:hover {
  border-color: var(--fc-violet);
  background: #f3f0ff;
}

.tool-empty h2 {
  margin: .2rem 0 0;
  color: var(--fc-ink);
  font-size: 1rem;
  font-weight: 800;
}

.tool-empty > p {
  margin: 0 0 .35rem;
  color: var(--fc-muted);
  font-size: .82rem;
}

.tool-empty .pair-upload-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  background: #eeecf8;
  color: var(--fc-violet);
  font-size: 1.65rem;
}

.inline-tool,
.content-card {
  max-width: 900px;
  margin: 1.5rem 0 2rem;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid var(--fc-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 39, 63, .05);
}

.content-card h2 {
  margin: 1.4rem 0 .65rem;
  color: var(--fc-ink);
  font-size: 1.15rem;
  font-weight: 800;
}

.content-card h2:first-child {
  margin-top: 0;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.contact-form {
  max-width: 720px;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid var(--fc-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 39, 63, .05);
}

.contact-form label,
.inline-tool .form-label {
  color: #344158;
  font-size: .85rem;
  font-weight: 750;
}

.contact-form .form-control,
.inline-tool .form-control,
.inline-tool .form-select {
  border-color: #d8deea;
  border-radius: 9px;
}

.metadata-table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  font-size: .88rem;
}

.metadata-table th {
  width: 38%;
  color: #59677e;
  font-weight: 700;
}

@media (max-width: 1199px) and (min-width: 992px) {
  .global-nav {
    gap: .8rem;
  }

  .global-brand {
    flex-basis: 175px;
  }

  .global-nav-links {
    gap: .65rem;
  }

  .global-search {
    width: 165px;
  }
}

@media (max-width: 1399px) and (min-width: 1200px) {
  .global-nav {
    height: 70px;
    min-height: 70px;
    gap: 0;
    padding-right: 6px;
    padding-left: 20px;
  }

  :root {
    --fc-header-height: 70px;
  }

  .global-brand {
    flex: 0 0 176px;
  }

  .global-nav-links {
    flex: 1 1 auto;
    min-width: 0;
    gap: clamp(.75rem, 1.6vw, 1.25rem);
    margin-left: clamp(1.25rem, 3vw, 2.75rem);
  }

  .global-nav-links a,
  .pdf-mega-menu > summary {
    font-size: .82rem;
  }

  .pdf-tools-menu > summary {
    color: var(--fc-violet);
  }

  .global-search {
    width: 200px;
    margin-left: auto;
  }
}

@media (max-width: 991px) {
  site-header {
    min-height: 67px;
  }

  :root {
    --fc-header-height: 66px;
  }

  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-brand p {
    max-width: 420px;
  }

  .global-nav {
    position: relative;
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding-top: .65rem;
    padding-bottom: .65rem;
  }

  .global-brand {
    flex: 0 1 205px;
  }

  .global-menu-toggle {
    display: block;
    margin-left: auto;
  }

  .global-search {
    display: none;
    order: 3;
    width: 100%;
    margin: .1rem 0 .25rem;
  }

  .global-nav.is-expanded .global-search {
    display: flex;
  }

  .global-nav-links {
    display: none;
    height: auto;
    flex: 1 0 100%;
    order: 2;
    align-items: stretch;
    gap: 0;
    padding: .3rem 0 .5rem;
  }

  .global-nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .global-nav-links > a {
    padding: .65rem .2rem;
    border-top: 1px solid #edf0f5;
  }

  .global-nav-links > .account-signup {
    align-self: flex-start;
    margin-top: .55rem;
    padding: .55rem .9rem;
  }

  .pdf-mega-menu {
    align-self: stretch;
    display: block;
    border-top: 1px solid #edf0f5;
  }

  .pdf-mega-menu > summary {
    padding: .65rem .2rem;
    font-size: .9rem;
  }

  .pdf-mega-menu[open] > .pdf-mega-panel {
    position: static;
    width: 100%;
    max-height: 55vh;
    padding: .8rem 0;
    transform: none;
    border: 0;
    border-top: 1px solid #edf0f5;
    border-radius: 0;
    box-shadow: none;
  }

  .pdf-mega-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .pdf-mega-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pdf-mega-category > summary {
    padding: .45rem 0;
  }

  .pdf-mega-category:not([open]) .pdf-mega-links {
    display: none;
  }
}

@media (max-width: 767px) {
  .pdf-mega-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  .converter-breadcrumb {
    padding-top: .9rem;
    font-size: .72rem;
  }

  .content-page {
    padding-top: .8rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1.2rem;
  }

  .pair-preview-layout,
  .pair-complete-layout {
    grid-template-columns: 1fr;
  }

  .pair-preview-image,
  .pair-result-image {
    max-height: 250px;
  }

  .pair-source-tabs {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .site-footer {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
  }

  .footer-container {
    padding-right: 20px;
    padding-left: 20px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem;
    margin-top: 2rem;
  }

  .footer-bottom .footer-note,
  .footer-legal {
    grid-column: 1;
    grid-row: auto;
  }

  .footer-legal {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .pdf-mega-panel {
    animation: none;
  }

  .pair-source-tab {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .global-brand {
    flex-basis: 180px;
  }

  .pair-setting-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    gap: 1.25rem;
  }
}
