.private-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 18px;
  color: var(--ink);
}

.private-shell h1 {
  margin: 0 0 12px;
  font-size: 30px;
}

.private-shell form {
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.form-alert {
  max-width: 420px;
  border: 1px solid rgba(154, 56, 18, .28);
  background: #fff6ed;
  color: #8f3515;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.private-shell label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.private-shell input,
.private-shell button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.private-shell button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.private-app {
  padding-top: 18px;
  padding-bottom: 36px;
  color: var(--ink);
}

.private-app h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: 0;
}

.private-app h2 {
  font-size: 24px;
}

.private-header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}

.private-session-label,
.muted,
.result-row small,
.admin-page small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.private-nav {
  display: flex;
  position: static;
  left: auto;
  right: auto;
  top: auto;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

.admin-actions-panel {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.admin-actions-panel h2 {
  margin-top: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions a,
.admin-form button,
.search-bar button,
.primary-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.search-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding-top: 18px;
}

.search-bar,
.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.admin-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  max-width: none;
}

.search-bar label,
.admin-form label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.search-bar input,
.search-bar select,
.admin-form input,
.admin-form select,
.admin-form textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.admin-form textarea {
  min-height: 110px;
}

.relationship-selector-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.relationship-endpoint-choices {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.relationship-endpoint-choices legend {
  padding: 0 4px;
  font-weight: 700;
}

.endpoint-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.endpoint-choice input {
  grid-row: 1 / span 3;
  margin-top: 3px;
}

.endpoint-choice span,
.endpoint-choice small {
  min-width: 0;
}

.endpoint-choice small {
  color: var(--muted);
  font-weight: 500;
}

.result-row {
  display: grid;
  grid-template-columns: 76px 160px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.result-row.is-selected {
  background: var(--soft-2);
  border-radius: 6px;
  padding-left: 8px;
  padding-right: 8px;
}

.result-row.is-discontinued,
.part-card.is-discontinued,
.admin-page tr.is-discontinued {
  background: #b8bdc1;
  color: #172027;
}

.admin-page tr.geo-disabled {
  background: #fff0d8;
}

.admin-page tr.cross-company-base {
  background: #fff3e2;
}

.base-company-warning {
  display: block;
  color: #8a4b00;
  font-weight: 600;
  margin-top: 6px;
}

.warning {
  display: block;
  margin-top: 6px;
  color: #8a4b00;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.checkbox-line input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

.danger {
  color: #8b1e1e;
  font-weight: 800;
}

.admin-form-grid {
  display: grid;
  gap: 14px;
}

.thumb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}

.thumb img,
.piece-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-panel,
.results-panel,
.detail-page,
.admin-page {
  padding: 16px 0;
}

.results-panel {
  min-width: 0;
}

.results-scroll {
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  padding-right: 8px;
}

.detail-panel {
  position: sticky;
  top: 130px;
  align-self: start;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-actions .is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.detail-actions .mobile-only {
  display: none;
}

.detail-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.report-improvement-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
}

.report-return-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.report-return-actions .mobile-only {
  display: none;
}

.part-card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.detail-panel .part-card {
  grid-template-columns: minmax(130px, 160px) minmax(0, 1fr);
  gap: 14px;
}

.detail-panel .part-card h1 {
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.part-card dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
}

.detail-panel .part-card dl {
  grid-template-columns: 1fr;
}

.detail-panel .part-card dd {
  margin: 0 0 8px;
}

.part-card dt {
  font-weight: 800;
}

.catalog-card-block {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.catalog-card {
  width: min(720px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.image-fallback,
.notice,
.empty {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
}

.image-fallback.big {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.search-start-state {
  padding: 14px;
  border: 1px solid rgba(46, 151, 75, 0.24);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}

.search-start-message {
  margin: 0 0 10px;
}

.search-scope-note {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.search-scope-note p {
  margin: 0;
}

.search-scope-note ul {
  margin: 0;
  padding-left: 18px;
}

.search-scope-note li + li {
  margin-top: 5px;
}

.admin-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
}

.admin-page th,
.admin-page td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-page input,
.admin-page select,
.user-row-form input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.user-row-form {
  display: contents;
}

.user-create-tool {
  margin-bottom: 26px;
}

.user-create-tool h2,
.user-list-tool h2 {
  margin-top: 0;
}

.user-list-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 14px;
}

.user-list-filters label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.user-list-filters input,
.user-list-filters select,
.user-list-filters button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.user-list-filters button {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.user-table-scroll {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 22px;
}

.users-table {
  min-width: 1840px;
  margin: 0;
}

.users-table th {
  white-space: nowrap;
}

.users-table th,
.users-table td {
  padding: 5px 6px;
  line-height: 1.2;
}

.users-table td > label,
.users-table td > select,
.users-table td > input,
.users-table td > small {
  margin-top: 2px;
  margin-bottom: 2px;
}

.users-table th,
.users-table td {
  white-space: nowrap;
}

.users-table .user-col-name { min-width: 180px; }
.users-table .user-col-email { min-width: 190px; }
.users-table .user-col-recovery { min-width: 205px; }
.users-table .user-col-company { min-width: 180px; }
.users-table .user-col-base { min-width: 210px; }
.users-table .user-col-role { min-width: 150px; }
.users-table .user-col-status { min-width: 110px; }
.users-table .user-col-radius { min-width: 92px; }
.users-table .user-col-language { min-width: 142px; }
.users-table .user-col-password { min-width: 205px; }
.users-table .user-col-activity { min-width: 150px; }
.users-table .user-col-action { min-width: 86px; }

.users-table td > label {
  display: grid;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
}

.users-table td > input,
.users-table td > select {
  min-height: 30px;
  padding: 4px 6px;
}

.users-table td > input,
.users-table td > select,
.users-table td > button {
  box-sizing: border-box;
}

.user-access-email {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.users-table .user-row-form small {
  display: block;
  font-size: 11px;
  line-height: 1.15;
}

.user-boolean-cell {
  width: 72px;
  text-align: center;
}

.user-boolean-cell .checkbox-line {
  justify-content: center;
  margin: 0;
}

.user-compact-badge {
  display: inline-block;
  margin: 2px 2px 0 0;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: #8a4b00;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.user-compact-badge[hidden] {
  display: none;
}

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

.user-filter-empty {
  margin: 0 0 22px;
}

.catalog-import-assistant {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .7fr);
  gap: 18px;
  align-items: start;
  margin: 14px 0 26px;
}

.catalog-import-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 12px;
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.intent-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
}

.intent-card.is-selected {
  border-color: var(--green);
  background: #eef7ef;
}

.intent-card input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}

.advanced-fields,
.next-steps-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 14px;
}

.advanced-fields summary {
  cursor: pointer;
  font-weight: 800;
}

.next-steps-panel {
  position: sticky;
  top: 120px;
}

.next-steps-panel h2 {
  margin-top: 0;
}

.next-steps-panel li + li {
  margin-top: 8px;
}

.workflow-board .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7ef;
  color: #214f2f;
  font-size: 12px;
  font-weight: 800;
}

.catalog-actions {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.catalog-actions form {
  display: grid;
  gap: 8px;
  margin: 0;
}

.catalog-actions button,
.catalog-actions .button {
  width: 100%;
}

.secondary-action {
  border-color: var(--line) !important;
  background: var(--paper) !important;
  color: var(--ink) !important;
}

.geo-rejected-location td {
  background: #fff7e8;
  border-left: 4px solid #d88a2d;
}

.geo-rejected-location h3 {
  margin: 0 0 8px;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.inline-admin-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--paper);
}

.graphical-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  gap: 18px;
  align-items: start;
}

.diagram-panel,
.section-diagram,
.diagram-empty {
  min-width: 0;
}

.section-diagram {
  margin: 0;
}

.section-diagram-frame {
  position: relative;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  vertical-align: top;
}

.section-diagram img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 620px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.diagram-hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.diagram-hotspot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  border: 2px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  pointer-events: auto;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}

.diagram-hotspot span {
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.diagram-hotspot:hover,
.diagram-hotspot:focus-visible {
  border-color: var(--accent);
  background: rgba(232, 248, 252, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 91, 112, 0.22);
  outline: none;
}

.diagram-hotspot:hover span,
.diagram-hotspot:focus-visible span {
  opacity: 1;
}

.section-diagram figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.diagram-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--paper);
}

.diagram-hotspot-editor-section {
  margin-top: 18px;
}

.diagram-hotspot-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.hotspot-editor-frame {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.hotspot-editor-frame img {
  display: block;
  width: 100%;
  max-height: min(72vh, 680px);
  object-fit: contain;
}

.hotspot-editor-layer {
  position: absolute;
  inset: 0;
  cursor: default;
  touch-action: pan-y;
}

.diagram-hotspot-editor-form.is-drawing-mode .hotspot-editor-layer {
  cursor: crosshair;
  touch-action: none;
}

.hotspot-editor-rect {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid rgba(15, 91, 112, 0.85);
  border-radius: 5px;
  background: rgba(232, 248, 252, 0.42);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  cursor: move;
  touch-action: none;
}

.hotspot-editor-rect.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 91, 112, 0.22);
}

.hotspot-editor-rect.is-discarded {
  border-style: dashed;
  opacity: 0.55;
}

.hotspot-editor-resize {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: nwse-resize;
  touch-action: none;
}

.hotspot-editor-controls {
  display: grid;
  gap: 10px;
}

.hotspot-geometry-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.hotspot-geometry-fields legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.hotspot-editor-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hotspot-editor-list button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 8px 10px;
}

@media (max-width: 760px) {
  .site-header {
    position: static;
  }

  .nav-inner {
    min-height: auto;
    padding: 8px 0;
    align-items: flex-start;
    gap: 8px;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 104px;
  }

  .brand-mark img {
    width: 72px;
  }

  .private-header-meta,
  .search-workbench,
  .relationship-selector-grid,
  .graphical-layout,
  .part-card {
    display: block;
  }

  .private-session-label {
    margin: 4px 0 2px;
    font-size: 11px;
  }

  .private-nav {
    display: flex !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    flex-direction: row !important;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    padding: 0 0 4px;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    max-height: 42px;
    scrollbar-width: none;
  }

  .private-nav::-webkit-scrollbar {
    display: none;
  }

  .private-nav .nav-link {
    flex: 0 0 auto;
    min-height: 30px;
    font-size: 11px;
    padding: 6px 8px;
  }

  .topbar-inner {
    min-height: 32px;
  }

  .search-bar,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .user-list-filters {
    grid-template-columns: 1fr;
  }

  .user-table-scroll {
    margin-right: -2px;
  }

  .catalog-import-assistant,
  .intent-grid,
  .admin-action-grid,
  .diagram-hotspot-editor-grid {
    grid-template-columns: 1fr;
  }

  .next-steps-panel {
    position: static;
  }

  .detail-panel {
    display: none;
  }

  .search-workbench.embedded-detail-open .results-panel {
    display: none;
  }

  .search-workbench.embedded-detail-open .detail-panel {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 12px;
  }

  .graphical-workbench .detail-panel,
  .graphical-workbench #graphical-detail {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 14px;
  }

  .graphical-workbench.has-graphical-result .graphical-layout {
    display: flex;
    flex-direction: column;
  }

  .graphical-workbench.has-graphical-result #graphical-detail {
    order: 1;
    margin-top: 0;
    margin-bottom: 14px;
  }

  .graphical-workbench.has-graphical-result .diagram-panel {
    order: 2;
  }

  .diagram-hotspot {
    font-size: 11px;
  }

  .results-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .detail-actions .mobile-only {
    display: inline-flex;
  }

  .report-return-actions .desktop-only {
    display: none;
  }

  .report-return-actions .mobile-only {
    display: inline-flex;
  }

  .result-row {
    grid-template-columns: 64px 1fr;
  }

  .result-row > span:last-child {
    grid-column: 1 / -1;
  }
}

.translation-mark {
  color: #5f6b7a;
  font-size: 0.88em;
  font-weight: 600;
}

.part-description-main {
  margin-bottom: 4px;
}

.part-description-original,
.original-text-inline,
.translation-original-label {
  color: #5f6b7a;
  font-size: 0.88rem;
}

.translation-grid {
  display: grid;
  gap: 12px;
}

.translation-card {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.translation-card header {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
}

.translation-form {
  display: grid;
  gap: 10px;
}

.translation-form textarea {
  min-height: 74px;
}
