*, *::before, *::after {
  box-sizing: border-box;
}

  :root {
    --cli-bg: #c0c0c0;
    --cli-border: #999;
    --cli-text: #000;
    --cli-input-bg: #fff;
    --cli-button-bg: #e0e0e0;
    --cli-button-border: #444;
  }

  .vision-app {
    font-family: 'Courier New', monospace;
    background: var(--cli-bg);
    color: var(--cli-text);
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    border: 2px inset var(--cli-border);
  }

  .vision-screen {
    display: none;
  }

  .vision-screen[data-screen="1"] {
    display: block;
    text-align: center;
    padding: 40px;
  }

  .vision-logo img {
    width: 200px;
    height: auto;
  }

  .vision-logo h1 {
    font-size: 32px;
    font-weight: bold;
    margin-top: 10px;
    text-shadow: 1px 1px #fff;
  }

  .vision-cli {
    background: var(--cli-bg);
    padding: 20px;
    /*border: 2px inset var(--cli-border);*/
  }

  .cli-input {
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 6px;
    border: 2px inset var(--cli-border);
    background: var(--cli-input-bg);
    color: var(--cli-text);
  }

  

  button {
      font-family: "MS Sans Serif", sans-serif;
      font-size: 13px;
      color: black;
      background-color: #c0c0c0;
      border: 2px solid;
      border-top-color: #fff;
      border-left-color: #fff;
      border-right-color: #404040;
      border-bottom-color: #404040;
      padding: 3px 12px;
      box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
      outline: none;
      cursor: default;
  }

  button:active {
      border-top-color: #404040;
      border-left-color: #404040;
      border-right-color: #fff;
      border-bottom-color: #fff;
      box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
  }

  button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .vision-category {
    font-weight: bold;
    margin-bottom: 10px;
  }

  .vision-part {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px;
    border: 1px solid #999;
    margin-bottom: 8px;
  }

  .part-thumb img {
    width: 64px;
    height: 64px;
    background-color: #3895d3;
    width: 200px;
    flex: none;
  }

  div.part-thumb {
      background-color: #3895d3;

      border: 2px solid #999;
      box-shadow: inset -1px -1px 0 #666, inset 1px 1px 0 #ccc,
                  4px 4px 8px rgba(0, 0, 0, 0.4); /* bevel + drop */
      padding: 2px;

  }

  .part-thumb:hover {
    outline: 2px solid #FFF;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
  }



  .part-det {
      width: 205px;
  }

  .part-total {
      width: 265px;
  }

  .part-price {
      width: 65px;
  }

  .part-info {
    margin-left: 12px;
    flex: 1;
    flex-grow: 1;
    min-width: 300px;
  }

  .part-info-icon {
    background: #0077cc;
    color: white;
    padding: 2px 5px;
    margin-left: 4px;
    border-radius: 4px;
    font-size: 0.6em;
    vertical-align: 2px;
  }

  #diagram-area, #diagram-sidebar {
    background: #fff;
    border: 2px inset #999;
    padding: 10px;
    margin-top: 10px;
  }

.vision-logo-small {
  text-align: center;
  margin-top: 20px;
}

.vision-logo-small img {
  width: 250px;
  height: auto;
  margin-top: 20px;
}

.cli-dropdown {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 2px inset var(--cli-border);
  background: var(--cli-input-bg);
  max-height: 150px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  z-index: 10;
  position: relative;
}

.cli-dropdown li {
  padding: 6px;
  cursor: pointer;
}

.cli-dropdown li:hover {
  background: #d0d0ff;
}

.model-option-box {
  border: 2px inset var(--cli-border);
  padding: 10px;
  margin-top: 10px;
  background: #fff;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.2s ease;
}

.model-option-box:hover {
  background-color: #eef6ff;
}

.model-option-box input[type="radio"] {
  margin-right: 10px;
}

.model-option-box input[type="radio"]:checked + label,
.model-option-box input[type="radio"]:checked ~ label {
  font-weight: bold;
}

.model-option-box small {
  display: block;
  color: #555;
  margin-top: 4px;
}

.model-thumb {
  width: 60px;
  height: auto;
  object-fit: contain;
  border: 1px solid #ccc;
  background: white;
  padding: 2px;
}

.model-option-box label {
  font-size: 0.85rem;
  line-height: 1.2;
}

.vision-header-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: #eee;
  padding: 10px;
  margin-bottom: 10px;
  border: 2px inset var(--cli-border);
  font-family: 'Courier New', monospace;
}
.vision-header-bar > div {
  min-width: 120px;
}
#category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size:17px;
}

#category-list li {
  padding: 6px;
  cursor: pointer;
}

#category-list li.active {
  background: #3895d3;
  font-weight: bold;
  color:white;
}

#vision-sidebar .cli-input {
  width: 90%;
  max-width: 160px;
}
#vision-sidebar .vision-diagram {
  width: 100%;
  box-sizing: border-box;
  display: block;
  margin-top: 10px;
  padding: 6px;
}
.vision-part {
  display: flex;
  align-items: flex-start;
  background: #fff;
  padding: 10px;
  border: 1px solid #999;
  margin-bottom: 8px;
  gap: 10px;
}

.part-info {
  flex: 1;
}

.part-desc {
  font-weight: bold;
}

.part-number {
  margin-top: 4px;
  font-family: monospace;
}

.part-info-icon {
  background: #0077cc;
  color: white;
  padding: 1px 5px;
  border-radius: 50%;
  font-weight: bold;
  margin-left: 4px;
  cursor: help;
}

.part-price {
  color: green;
  font-weight: bold;
  margin-top: 4px;
}

.part-name {
  font-weight: bold;
}

.part-number {
  color: #666;
  font-size: 0.9em;
}

.vision-screen[data-screen="5"] {
  display: flex;
  flex-grow: 1;
  width: 100%;
  gap: 2rem;
}

.vision-screen5-layout {
  display: flex;
  max-width: 1400px;
  align-items: stretch;
  height: 78vh; /* or whatever container height you need */
}

.diagram-column {
  flex: 0 0 auto;
  overflow:hidden;
  display: flex;
  align-items: stretch;
  position: relative;
  height: 100%;
  width: auto;
}

.parts-column {
  flex: 1;
  display: flex;
  gap: 1rem;
}

.category-sidebar {
  flex: 0 0 180px;
  background: #f0f0f0;
  padding: 1rem;
}

.screen5-results {
  flex: 1;
}
#interactive-diagram-container svg {
  height: 100%;
  width: auto;
  display: block;
  max-height: 100%;
}

#interactive-diagram-container {
  height: 100%;
  position: relative;
  overflow: hidden;
  display:flex;
  justify-content: flex-end;
  background-color: #3895d3;
}

.highlighted-part {
  outline: 2px solid yellow;
  background-color: #ffffcc;
  transition: background-color 0.3s ease;
}

input[type="text"].cli-input ,
input[type="number"].cli-input, 
select.cli-input {
  width: 250px; /* or whatever "normal" width looks best for your layout */
  max-width: 100%;
}

.vision-screen.centered-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vision-screen.centered-screen form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.vision-screen.centered-screen input,
.vision-screen.centered-screen select {
  width: 250px;
  max-width: 100%;
}

#vision-container {
    font-weight: initial;
}

#screen-5-right {
  display: flex;
  flex-direction: row;
  width: 100%;
  background: #c0c0c0;
  padding: 4px;
  border: 2px solid #808080;
  box-shadow:
    inset -2px -2px 0 #ffffff,   /* top-left highlight */
    inset 2px 2px 0 #404040;     /* bottom-right shadow */

}

#screen5-part-results .part-row {
  font-size: 0.85em;
}

.screen5-category-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.screen5-category-item:hover {
  background-color: #d0d0d0;
}

.screen5-category-item.active {
  background-color: #3895d3;
  font-weight: bold;
  color:white;
}


.vision-screen[data-screen="2"] input,
.vision-screen[data-screen="2"] select {
  width: 190px;
  max-width: 100%;
  margin: 8px auto;
}

.button-row {
  text-align: center;
}

.vision-logo-side img {
    width: 200px;
    height: auto;
    margin-top: 20px;
}

.vision-logo-side {
  text-align: center;
  margin-bottom: 20px;
}

.vision-logo-top img {
    width: 150px;
    height: auto;
}

.vision-logo-top {
  text-align: center;
  margin-bottom: 20px;
}

#screen5-category-list {
    display: flex;
    flex: 0 0 150px;
    flex-direction: column;
    font-size: 17px;

    min-width: 180px;

    border-left: 2px solid #000;
    border-right: 2px solid #888;
    height: 100%;
    background: #FFF; 
}

.screen5-category-listitems {
    
    border-radius: 4px;
    flex: 1;

    overflow-y: hidden;
    
    
}

.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #c0c0c0;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  font-family: 'Tahoma', sans-serif;
  border: solid 1px white;
  z-index:2;
}

.fixed-bottom-bar-inner {
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    width:100%;
}



.part-row {
    border: 2px solid transparent;
    transition: border-color 0.2s;
    padding: 5px;
}

.part-row:hover, .hover-highlight {
    border-color: #3399ff;
    background: rgba(51,153,255,0.1);
}




#results-list {
    overflow-y: hidden;
    scrollbar-width: auto; /* Firefox */
    scrollbar-color: #aaa #ddd;
    padding-right: 16px; /* make room for scrollbar so it doesn't overlap */
    border-right: 2px solid #444;
    border-left: 2px solid #444;
    margin: 0 auto;
    max-width: 100%; /* or match your interface width */
    box-sizing: border-box;
}

.vision-results-column {
  flex: 1;
  display: flex;
  background: #FFF; 
  flex-direction: column;
  height: 100%;
  border-left: 1px solid #ccc;
  overflow:hidden;
}

#screen5-part-results {
  overflow-y: hidden;
  
  height: 100%;
}

.screen5-category-title {
  padding: 10px;
  background: #ddd;
  font-weight: bold;
  flex-shrink: 0;
  text-transform: uppercase;
  text-align: center;
  margin: 0;
  border-bottom: 1px solid #9a9a9a;
  flex: 0 0 auto;
}

#results-list::-webkit-scrollbar, #screen5-part-results::-webkit-scrollbar, #screen5-category-list::-webkit-scrollbar {
  width: 16px;
  background: #c0c0c0; /* scrollbar track */
}

#results-list::-webkit-scrollbar-thumb, #screen5-part-results::-webkit-scrollbar-thumb, #screen5-category-list::-webkit-scrollbar-thumb {
  background: #808080;
  border: 2px solid #c0c0c0; /* to give that boxy inset feel */
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #000; /* beveled look */
}

#results-list::-webkit-scrollbar-track, #screen5-part-results::-webkit-scrollbar-track, #screen5-category-list::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-left: 1px solid #fff;
  border-top: 1px solid #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}


#serial-match-count {
    text-align: center;
}

.win95-scroll-wrapper {
  display: flex;
  flex: 1 1 auto;
  height: 100%;
  position: relative; /* Needed for absolute scrollbar */
    min-height: 0; /* prevents flex overflow in some browsers */
}

.win95-scroll-content {
  flex: 1;
  overflow-y: hidden;
  height: 100%;
  box-sizing: border-box;
}

/* The actual scrollbar */
.win95-scrollbar-track {
  width: 24px;
  background: #c0c0c0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-left: 2px solid #000;
  border-top: 2px solid #000;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  user-select: none;
  position: relative;
}

.win95-arrow {
  width: 100%;        /* make it exactly as wide as the track */
  height: 20px;        /* adjust as needed */
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: black;
  background: #e0e0e0;
  border: 2px outset #fff;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.win95-arrow:hover {
  background: #d0d0d0;
}

.win95-thumb-track {
  flex: 1;
  position: relative;
}


.win95-scroll-thumb {
  position: absolute;
  width: 100%;
  height: 30px;
  top: 0;
  background: #e0e0e0;
  border: 2px outset #fff;
  
  cursor: pointer;
  z-index: 1;
}

.win95-scrollbar-track-alt {
      background: #fff;
      border-left: none;
}

.win95-scroll-thumb-alt {
  background: #e0e0e0;
  border: 2px inset #f0f0f0;
  box-shadow: inset -1px -1px 0 #fefefe, inset 1px 1px 0 #888;
}

.vision-next {
    cursor: pointer;
}

.vision-clickable {
    cursor: pointer;
}

.zoom-controls {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 10px;
  right: 10px;
  gap: 6px;
  z-index: 10;
}

.zoom-controls button {
  width: 32px;
  height: 32px;
  background: #c0c0c0;
  border: 2px outset #fff;
  box-shadow: -1px -1px 0 #fff, 1px 1px 0 #000;
  font-size: 20px;
  font-weight: bold;
  line-height: 26px;
  text-align: center;
  padding: 0 0 28px 0;
  cursor: pointer;
  user-select: none;
  
}

#interactive-diagram-container text {
  user-select: none;
  pointer-events: none;
}

svg path {
  vector-effect: non-scaling-stroke;
}