/* X-Patents: kept neutral so it inherits the IP Mall theme's fonts and colors. */

.xpatents-intro { max-width: 52em; }
.xpatents-stats { font-size: 0.95em; color: #555; }

.xpatents-search { display: flex; flex-wrap: wrap; gap: 1em 2em; align-items: flex-end; margin: 1em 0; padding: 0.8em 1em; background: #f4f4f1; border: 1px solid #ddd; }
.xpatents-filters { display: flex; flex-wrap: wrap; gap: 0.8em 1.2em; align-items: flex-end; flex: 1 1 36em; }
.xpatents-field label, .xpatents-jump label { display: block; font-size: 0.85em; font-weight: bold; margin-bottom: 0.2em; }
.xpatents-field--q input { width: 18em; max-width: 100%; }
.xpatents-field--years input { width: 5em; }
.xpatents-actions a { margin-left: 0.6em; }
.xpatents-jump input { width: 6em; }

.xpatents-count { font-weight: bold; margin: 0.6em 0; }
.xpatents-table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.xpatents-table th, .xpatents-table td { padding: 0.35em 0.5em; border-bottom: 1px solid #e3e3e3; text-align: left; vertical-align: top; }
.xpatents-table thead th { border-bottom: 2px solid #999; white-space: nowrap; }
.xpatents-table th a { text-decoration: none; }
.xpatents-col-x, .xpatents-col-date { white-space: nowrap; }
.xpatents-col-images { white-space: nowrap; color: #666; font-size: 0.9em; }
.xpatents-unused td { color: #888; }

@media (max-width: 700px) {
  .xpatents-col-residence { display: none; }
}

/* Drawings gallery */
.xpatents-tabs { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3em; }
.xpatents-tabs li a { display: block; padding: 0.3em 0.8em; border: 1px solid #ccc; text-decoration: none; }
.xpatents-tabs li.is-active a { background: #333; color: #fff; border-color: #333; }
.xpatents-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1em; }
.xpatents-grid a { display: block; text-decoration: none; color: inherit; }
.xpatents-grid img { display: block; width: 100%; height: 170px; object-fit: contain; background: #f4f4f1; border: 1px solid #ddd; }
.xpatents-grid span { display: block; font-size: 0.85em; line-height: 1.3; }
.xpatents-grid__x { font-weight: bold; margin-top: 0.3em; }
.xpatents-grid__src { color: #777; }

/* Patent page */
.xpatent-nav { display: flex; justify-content: space-between; align-items: center; gap: 1em; margin: 0 0 1em; padding: 0.4em 0; border-bottom: 1px solid #ddd; font-size: 0.9em; }
.xpatent-nav__prev, .xpatent-nav__next { flex: 1 1 0; }
.xpatent-nav__next { text-align: right; }
.xpatent-nav__home { text-align: center; white-space: nowrap; }
.xpatent-nav__go { display: inline; margin-left: 0.6em; }
.xpatent-nav__go input { width: 6em; }

.xpatent-gallery { margin-top: 1.5em; }
.xpatent-doc { margin: 0 0 1.5em; padding-bottom: 1em; border-bottom: 1px solid #e3e3e3; }
.xpatent-doc:target { outline: 3px solid #f0c040; outline-offset: 6px; }
.xpatent-doc__title { margin-bottom: 0.2em; }
.xpatent-doc__flag { font-size: 0.7em; background: #c33; color: #fff; padding: 0.1em 0.4em; margin-left: 0.5em; vertical-align: middle; }
.xpatent-doc--unpublished { opacity: 0.75; }
.xpatent-doc__caption { margin: 0 0 0.6em; }
.xpatent-doc__sheets { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.8em; }
.xpatent-doc__sheets li { width: 220px; }
.xpatent-doc__sheets--many li { width: 140px; }
.xpatent-doc__sheets img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; background: #f4f4f1; border: 1px solid #ddd; }
.xpatent-doc__sheets--many img { max-height: 190px; }
.xpatent-sheet__title { display: block; font-size: 0.8em; color: #555; line-height: 1.3; margin-top: 0.2em; }
.xpatent-doc__credit { font-size: 0.85em; color: #555; margin-top: 0.6em; }
.xpatent-doc__transcription { margin-top: 0.8em; }
.xpatent-doc__text { max-width: 48em; margin: 0.4em 0; padding-left: 1em; border-left: 3px solid #ddd; }
.xpatent-doc__transcription summary { cursor: pointer; font-weight: bold; }
.xpatent-doc__transcription > div, .xpatent-doc__transcription p { max-width: 48em; }

.xpatent-submit { margin: 1.5em 0; padding: 0.8em 1em; border: 1px solid #ddd; background: #f8f8f5; }
.xpatent-submit h2 { font-size: 1.1em; margin-top: 0; }
.xpatent-submit--wanted { border-color: #d8b24a; background: #fdf8e8; }
.xpatent-submit__email { font-size: 0.85em; color: #555; margin-left: 0.6em; }

.xpatent-record { margin: 1.5em 0; font-size: 0.9em; }
.xpatent-record summary { cursor: pointer; font-weight: bold; }
.xpatent-record dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2em 1em; }
.xpatent-record dt { font-weight: bold; }
.xpatent-record dd { margin: 0; }

/* Viewer */
.xpatents-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 20, 20, 0.92); display: flex; flex-direction: column; color: #eee; }
.xpatents-viewer[hidden] { display: none; }
.xpatents-viewer__bar { display: flex; align-items: center; gap: 1em; padding: 0.5em 1em; font-size: 0.9em; }
.xpatents-viewer__bar a { color: #fff; }
.xpatents-viewer__caption { flex: 1; }
.xpatents-viewer button { background: transparent; color: #fff; border: 1px solid #888; padding: 0.3em 0.8em; cursor: pointer; font-size: 1em; }
.xpatents-viewer__stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 3.5em 1em; position: relative; }
.xpatents-viewer__stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.xpatents-viewer__prev, .xpatents-viewer__next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.6em !important; }
.xpatents-viewer__prev { left: 0.4em; }
.xpatents-viewer__next { right: 0.4em; }
