:root {
  color-scheme: light;
  --brand: #4963f6;
  --brand-rgb: 73, 99, 246;
  --app-header-height: 72px;
  --app-bottom-gap: 32px;
}

* {
  box-sizing: border-box;
}

#cart-section {
  margin-top: 0;
}

#view-cart {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.4;
  background: #f6f7f9;
  color: #111827;
}

body.is-loading {
  overflow: hidden;
}

body.custom-request-modal-open {
  overflow: hidden;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(4px);
}

.app-loading.is-hidden {
  display: none;
}

.app-loading-card {
  min-width: min(320px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  border: 1px solid #dbe1ea;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.12);
}

.app-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(var(--brand-rgb), 0.18);
  border-top-color: rgb(var(--brand-rgb));
  border-radius: 999px;
  animation: app-loading-spin 0.8s linear infinite;
}

.app-loading-message {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
}

@keyframes app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-select {
  width: auto;
  min-width: 90px;
  padding: 9px 6px;
  cursor: pointer;
}

.search-input {
  width: min(420px, 52vw);
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
}

.search-input::placeholder {
  color: #6b7280;
  font-weight: 500;
}

.search-input:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.header-logo {
  height: 28px;
  width: auto;
  max-width: 220px;
}

.logo-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.logo-button:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 4px 16px 16px;
}

.container.is-wide {
  width: 100%;
  max-width: none;
}

.title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

.browse-sticky-header {
  position: sticky;
  top: var(--app-header-height);
  z-index: 20;
  margin: -16px -16px 12px;
  padding: 16px 16px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: blur(8px);
}

#cart-back {
  margin: 0 0 8px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.part-detail-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Dynamic split: stacked below 1000px, side-by-side at 1000px+ */
@media (min-width: 1000px) {
  .part-detail-panels {
    grid-template-columns: minmax(360px, 1.35fr) minmax(360px, 1fr);
    align-items: start;
  }

}

.breadcrumb-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.field-required {
  color: #dc2626;
  margin-left: 4px;
}

.breadcrumb-link,
.breadcrumb-current {
  text-transform: uppercase;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-link:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.designer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
}

.designer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.designer-output {
  display: flex;
  align-items: center;
  gap: 10px;
}

.designer-coords {
  width: min(520px, 52vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.designer-rect {
  position: absolute;
  border: 2px dashed rgba(var(--brand-rgb), 0.95);
  background: rgba(var(--brand-rgb), 0.10);
  border-radius: 6px;
  pointer-events: none;
}

.muted {
  color: #6b7280;
}

h2 {
  margin-top: 0;
  margin-bottom: 0;
}

#part-detail-breadcrumb {
  margin-top: 0;
  margin-bottom: 12px;
}

#part-detail-subtitle {
  margin-top: 0;
  margin-bottom: 0;
}

.part-detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 3px;
  margin: 8px 0 0;
  font-size: 13px;
}

.part-detail-meta dt {
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}

.part-detail-meta dd {
  margin: 0;
  color: #374151;
}

.part-detail-comment {
  white-space: pre-line;
}

.meta-link {
  color: #4963f6;
  text-decoration: none;
}

.meta-link:hover {
  text-decoration: underline;
}

.text-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.cart-custom-request-link-row {
  margin-top: 12px;
}

#part-detail-heading {
  margin-top: 0;
  margin-bottom: 0;
}

.small {
  font-size: 12px;
}

.hidden {
  display: none;
}

.custom-request-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.46);
  backdrop-filter: blur(6px);
}

.custom-request-modal.hidden {
  display: none;
}

.custom-request-modal-card {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #dbe1ea;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.24);
}

.custom-request-modal-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.custom-request-modal-header h2 {
  margin: 0;
}

.custom-request-textarea {
  min-height: 140px;
  resize: vertical;
}

.custom-request-actions {
  margin-top: 8px;
  justify-content: flex-end;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.list-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.list-item.has-thumb {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}

.part-thumb-wrap {
  width: 140px;
  flex: 0 0 140px;
  align-self: stretch;
  overflow: hidden;
  background: #f9fafb;
}

.part-thumb {
  width: 140px;
  flex: 0 0 140px;
  height: 150px;
  max-height: 150px;
  display: block;
  object-fit: contain;
  border-radius: 0;
  border: 0;
  background: #f9fafb;
  transform-origin: center center;
  transition: transform 0.9s ease;
}

.card-body {
  flex: 1;
  min-width: 0;
  padding: 5px;
}

.category-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: none;
  background: #f9fafb;
  margin: 0 0 10px;
  display: block;
}

/* Location images should show the full image (no cropping). */
.location-img {
  object-fit: contain;
}

/* Make location thumbnails larger for readability. */
.location-card .location-img {
  height: 200px;
}

/* Location header image on the location parts page. */
#location-parts-image.location-img {
  height: 320px;
}

.location-diagram-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

.category-card {
  text-align: center;
  overflow: hidden;
}

.subcategory-card.is-expanded {
  grid-column: 1 / -1;
  text-align: left;
}

.subcategory-card.is-expanded > h3 {
  margin: -12px -12px 0;
  position: relative;
  padding: 8px 44px;
  background: #4963f6;
  color: #ffffff;
  line-height: 1.2;
  text-align: center;
}

.subcategory-card.is-expanded > h3::after {
  content: "...";
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-weight: 700;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.subcategory-inline-parts {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.subcategory-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.subcategory-inline-actions {
  margin-top: 12px;
  text-align: right;
}

.subcategory-inline-more {
  color: #4963f6;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.subcategory-inline-more:hover {
  text-decoration: underline;
}

.subcategory-inline-more:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

.category-card .category-img {
  width: calc(100% + 24px);
  margin: -12px -12px 10px;
  border-radius: 10px 10px 0 0;
  transform: scale(1);
  transform-origin: center;
  transition: transform 140ms ease;
}

.category-card > h3,
.category-card > p {
  transition: transform 140ms ease;
  transform: scale(1);
  transform-origin: center;
}

/* Display category + part names in all caps (UI-only). */
.category-card h3,
.list-item h3,
#part-detail-heading,
#part-detail-breadcrumb {
  text-transform: uppercase;
}

/* Included items table: uppercase the Description column (3rd column). */
#included-items td:nth-child(3) {
  text-transform: uppercase;
}

.category-card:hover .category-img,
.category-card:focus-visible .category-img {
  transform: scale(1.07);
}

/* Disable the hover zoom on location cards to avoid any perceived cropping. */
.location-card:hover .category-img,
.location-card:focus-visible .category-img {
  transform: none;
}

.location-card:hover h3,
.location-card:focus-visible h3,
.location-card:hover p,
.location-card:focus-visible p {
  transform: none;
}

.category-card:hover > h3,
.category-card:focus-visible > h3 {
  transform: scale(1.05);
}

.subcategory-card.is-expanded:hover > h3,
.subcategory-card.is-expanded:focus-visible > h3 {
  transform: none;
}

.category-card:hover > p,
.category-card:focus-visible > p {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-spinner {
    animation: none;
  }

  .category-card .category-img,
  .category-card > h3,
  .category-card > p {
    transition: none;
  }
}

.list-item.is-clickable {
  cursor: pointer;
}

.list-item.is-clickable:hover {
  background: #f9fafb;
}

/*
  Chrome/Edge can show aliasing artifacts on PNG edges when the background behind
  a thumbnail changes on hover (especially with transparency). For thumbnail cards,
  keep the outer card background stable and only highlight the text body.
*/
.list-item.has-thumb.is-clickable:hover {
  background: #ffffff;
}

.list-item.has-thumb .card-body {
  background: #ffffff;
}

.list-item.has-thumb.is-clickable:hover .card-body {
  background: #f9fafb;
}

.list-item.is-clickable:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.list-item.is-highlighted {
  border-color: rgba(var(--brand-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.16);
}

.list-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.part-card-body h3 {
  margin: 0;
  flex: 1;
}

.list-item p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.card-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.search-section-header {
  grid-column: 1 / -1;
  margin: 16px 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.search-section-header:first-child {
  margin-top: 0;
}

/* Part card layout: description grows, footer always pinned to bottom */
.is-part-card {
  display: flex;
  flex-direction: column;
}

.is-part-card.has-thumb {
  flex-direction: row;
}

.is-part-card > .part-card-body {
  flex: 1;
}

.part-card-body {
  display: flex;
  flex-direction: column;
}

.card-actions-corner {
  flex-shrink: 0;
  margin: 8px 0 0;
  justify-content: flex-start;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  line-height: 0;
  position: relative;
}

.icon-button:hover {
  border: 2px solid #4963f6;
}

/* CSS tooltip via data-tooltip attribute */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  white-space: nowrap;
  background: #4963f6;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.part-card-number {
  color: #4963f6;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  align-self: center;
}

.button {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.button:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.button:hover {
  background: #f9fafb;
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.button:disabled:hover,
.button[aria-disabled="true"]:hover {
  background: #ffffff;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.button.primary:hover {
  filter: brightness(0.95);
}

#cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#search-toggle {
  display: none;
}

@media (max-width: 600px) {
  #search-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-bar {
    flex-wrap: wrap;
  }

  .header-search {
    display: none;
    order: 10;
    flex-basis: 100%;
    margin-left: 0;
    padding-bottom: 8px;
  }

  .header-search.search-open {
    display: flex;
  }

  .search-input {
    width: 100%;
  }

  .cart-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .cart-item-info {
    flex: 1 1 180px;
  }

  .cart-item-controls {
    flex: 1 0 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #cart-button.is-pulsing {
    animation: cartPulse 420ms ease-out;
  }

  #cart-button.is-pulsing .cart-badge {
    animation: cartBadgePulse 420ms ease-out;
  }
}

@keyframes cartPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0);
  }
  35% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(var(--brand-rgb), 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0);
  }
}

@keyframes cartBadgePulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  margin-left: 6px;
  background: rgba(var(--brand-rgb), 0.14);
  border: 1px solid rgba(var(--brand-rgb), 0.35);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.cart-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.cart-item {
  padding: 9px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-item + .cart-item {
  border-top: 1px solid #e5e7eb;
}

.cart-item-thumb-wrap {
  width: 96px;
  height: 64px;
  flex: 0 0 96px;
  overflow: hidden;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.cart-item-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

.cart-item-title {
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  color: #111827;
}

.cart-item-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #6b7280;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty {
  width: 84px;
}

.cart-toolbar {
  margin-top: 12px;
  justify-content: flex-start;
}

.checkout-confirmation {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(var(--brand-rgb), 0.07), rgba(var(--brand-rgb), 0.02));
}

.checkout-confirmation-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.checkout-confirmation-icon {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #86efac, #16a34a);
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.24);
}

.checkout-confirmation-icon svg {
  width: 72px;
  height: 72px;
}

.checkout-confirmation-icon circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2;
}

.checkout-confirmation-icon path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkout-confirmation h3,
.checkout-confirmation h4 {
  margin: 0 0 8px;
}

.checkout-confirmation-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  margin: 12px 0 14px;
}

.checkout-confirmation-field {
  display: grid;
  gap: 2px;
}

.checkout-confirmation-label {
  font-size: 12px;
  font-weight: 800;
  color: #374151;
}

.checkout-confirmation-value {
  color: #111827;
  overflow-wrap: anywhere;
}

.checkout-confirmation-items {
  display: grid;
  gap: 0;
}

.checkout-confirmation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.checkout-confirmation-item + .checkout-confirmation-item {
  border-top: 1px solid rgba(var(--brand-rgb), 0.18);
}

.checkout-confirmation-item-info {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #6b7280;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.checkout-confirmation-item-title {
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  color: #111827;
}

.checkout-confirmation-item-qty {
  white-space: nowrap;
  font-weight: 700;
  color: #111827;
}

.form {
  margin-top: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

#checkout-form .form-grid {
  grid-template-columns: 1fr;
}

#checkout-button {
  margin-top: 6px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 800;
  color: #374151;
}

.input {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
}

.input:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

#part-detail-panel-drawing {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
}

.drawing-wrap {
  flex: 1;
  min-width: 0;
}

.drawing-thumbnails {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawing-thumb {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
}

.drawing-thumb:hover {
  background: #f9fafb;
}

.drawing-thumb:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.drawing-thumb.is-selected {
  border-color: rgba(var(--brand-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.16);
}

.drawing-thumb-img {
  width: 96px;
  height: 68px;
  display: block;
  object-fit: contain;
  background: #f9fafb;
  border-radius: 8px;
}

.location-diagram {
  position: relative;
}

.location-hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.location-hotspot-overlay {
  position: absolute;
  pointer-events: auto;
  cursor: crosshair;
}

.location-hotspot-overlay.is-hovered {
  cursor: pointer;
}

.location-hotspot-hit {
  position: absolute;
  background: rgba(var(--brand-rgb), 0.14);
  border-radius: 6px;
  pointer-events: none;
}

#location-tooltip {
  white-space: pre-line;
}

.location-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(var(--brand-rgb), 0.08);
  border: 1px solid rgba(var(--brand-rgb), 0.25);
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
}

.location-filter-bar.hidden {
  display: none;
}

.location-filter-bar .button {
  padding: 4px 12px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.drawing {
  position: relative;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.drawing-viewport {
  position: relative;
  width: 100%;
  touch-action: none;
  overflow: hidden;
  max-height: 600px;
}

.drawing-pan {
  transform: translate(0px, 0px);
}

.drawing-scale {
  position: relative;
  transform-origin: 0 0;
  transform: scale(1);
}

.drawing-viewport.is-pannable {
  cursor: grab;
}

.drawing-viewport.is-panning {
  cursor: grabbing;
}

.drawing-viewport.is-panning .hotspot-layer {
  pointer-events: none;
}

.drawing-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  gap: 8px;
  z-index: 7;
}

.drawing-controls .button {
  min-width: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-weight: 900;
}

#drawing-canvas {
  display: block;
}

.hotspot-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
}

.hotspot {
  position: absolute;
  border: none;
  background: rgba(var(--brand-rgb), 0.12);
  border-radius: 6px;
  pointer-events: auto;
  cursor: pointer;
}

.hotspot.is-hovered {
  background: rgba(var(--brand-rgb), 0.18);
}

.tooltip {
  position: absolute;
  z-index: 5;
  max-width: 340px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
  font-size: 12px;
  color: #111827;
}

.context-menu {
  position: absolute;
  z-index: 6;
  min-width: 200px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

.context-menu button {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}

.context-menu button:hover {
  background: #f9fafb;
}

.context-menu button:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.35);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  font-size: 13px;
}

.table th {
  font-size: 12px;
  color: #374151;
  font-weight: 700;
  background: #f9fafb;
}

.table tbody tr.is-highlighted td {
  background: rgba(var(--brand-rgb), 0.10);
}

.table tbody tr.is-highlighted td:first-child {
  box-shadow: inset 3px 0 0 rgba(var(--brand-rgb), 0.85);
}
