* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Chicago, Geneva, Charcoal, 'Courier New', monospace;
  background: #888888;
  overflow: hidden;
  height: 100vh;
}

.desktop {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #666 75%, #666),
              linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #666 75%, #666);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
  background-color: #888;
}

.menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: white;
  border-bottom: 1px solid black;
  display: flex;
  z-index: 1000;
  font-size: 12px;
}

.menu-item {
  padding: 2px 12px;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.menu-item:hover,
.menu-item.active {
  background: black;
  color: white;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid black;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  min-width: 200px;
  z-index: 1001;
}

.menu-dropdown-item {
  padding: 4px 20px 4px 12px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.menu-dropdown-item:hover {
  background: black;
  color: white;
}

.menu-separator {
  height: 1px;
  background: #999;
  margin: 2px 0;
}

.window {
  position: absolute;
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  background: white;
  border: 3px solid black;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.title-bar {
  height: 20px;
  background: repeating-linear-gradient(
    0deg,
    #000,
    #000 1px,
    #fff 1px,
    #fff 2px
  );
  display: flex;
  align-items: center;
  padding: 0 4px;
  cursor: move;
  position: relative;
}

.title-text {
  flex: 1;
  text-align: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 0 black;
  pointer-events: none;
}

.window-button {
  width: 12px;
  height: 12px;
  border: 1px solid black;
  background: white;
  cursor: pointer;
}

.close-box {
  position: relative;
}

.close-box::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  left: 2px;
  top: 2px;
  background: white;
}

.zoom-box {
  position: relative;
}

.zoom-box::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  left: 3px;
  top: 3px;
  border: 1px solid black;
}

.toolbar {
  background: #cccccc;
  padding: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 2px solid #999;
  flex-wrap: wrap;
}

.system7-button {
  font-family: Chicago, Geneva, Charcoal, sans-serif;
  font-size: 11px;
  padding: 4px 12px;
  background: #dddddd;
  border: none;
  border-top: 2px solid white;
  border-left: 2px solid white;
  border-bottom: 2px solid #666;
  border-right: 2px solid #666;
  cursor: pointer;
  font-weight: bold;
}

.system7-button:active:not(:disabled) {
  border-top: 2px solid #666;
  border-left: 2px solid #666;
  border-bottom: 2px solid white;
  border-right: 2px solid white;
  background: #bbbbbb;
}

.system7-button:disabled {
  color: #999;
  cursor: not-allowed;
  background: #dddddd;
}

.status-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #333;
}

.led.ready {
  background: #999;
}

.led.scanning {
  background: #ffcc00;
  animation: pulse 1s infinite;
}

.led.complete {
  background: #00ff00;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.config-panel {
  background: #eeeeee;
  padding: 12px;
  border-bottom: 2px solid #999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex-wrap: wrap;
}

.config-row label {
  font-weight: bold;
  min-width: 100px;
}

.system7-input {
  font-family: Courier, monospace;
  font-size: 11px;
  padding: 2px 4px;
  border: 2px solid #999;
  border-top-color: #666;
  border-left-color: #666;
  background: white;
  outline: none;
}

.checkbox-label,
.radio-label {
  display: inline-flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
}

.results-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
}

.table-header {
  display: flex;
  background: #dddddd;
  border-bottom: 2px solid black;
  font-size: 11px;
  font-weight: bold;
}

.header-cell {
  flex: 1;
  padding: 6px 8px;
  border-right: 1px solid #999;
  cursor: pointer;
  user-select: none;
  border-top: 1px solid white;
  border-left: 1px solid white;
  min-width: 80px;
}

.header-cell:hover {
  background: #cccccc;
}

.header-cell.sorted {
  background: #bbbbbb;
}

.table-body {
  flex: 1;
  overflow-y: auto;
  font-size: 10px;
}

.table-row {
  display: flex;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

.table-row.even {
  background: white;
}

.table-row.odd {
  background: #f5f5f5;
}

.table-row:hover {
  background: #e0e0e0;
}

.table-cell {
  flex: 1;
  padding: 4px 8px;
  border-right: 1px solid #eee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 80px;
}

.status-bar {
  background: #cccccc;
  padding: 4px 8px;
  border-top: 2px solid #999;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  flex-wrap: wrap;
}

.progress-container {
  flex: 1;
  min-width: 150px;
}

.progress-bar {
  height: 12px;
  border: 1px solid black;
  background: white;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #000,
    #000 3px,
    #fff 3px,
    #fff 6px
  );
  transition: width 0.3s;
}

.berrry-link {
  margin-left: auto;
  font-size: 9px;
  color: #666;
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.dialog-box {
  background: white;
  border: 3px solid black;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  min-width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.dialog-content {
  padding: 20px;
  overflow-y: auto;
  font-size: 11px;
  flex: 1;
}

.dialog-buttons {
  padding: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid #999;
}

.device-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-icon {
  text-align: center;
  font-size: 48px;
  margin-bottom: 12px;
}

.detail-row {
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}

.ports-list {
  margin-top: 8px;
  padding-left: 20px;
}

.port-item {
  padding: 2px 0;
}

.about-dialog {
  text-align: center;
}

.about-icon {
  font-size: 64px;
  margin: 20px 0;
}

.about-dialog h2 {
  font-size: 14px;
  margin-bottom: 12px;
}

.about-dialog p {
  margin: 8px 0;
  font-size: 11px;
}

.preferences-dialog,
.help-dialog {
  font-size: 11px;
}

.pref-section {
  margin-bottom: 16px;
}

.pref-section h3 {
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: bold;
}

.help-dialog h3 {
  font-size: 12px;
  margin: 12px 0 8px 0;
  font-weight: bold;
}

.help-dialog p {
  margin: 4px 0;
}

/* Scrollbar styling */
.table-body::-webkit-scrollbar {
  width: 16px;
}

.table-body::-webkit-scrollbar-track {
  background: #ddd;
  border-left: 1px solid #999;
}

.table-body::-webkit-scrollbar-thumb {
  background: #999;
  border: 1px solid #666;
}

.table-body::-webkit-scrollbar-button {
  background: #ccc;
  border: 1px solid #999;
  height: 16px;
}

@media (max-width: 768px) {
  .window {
    width: 95vw;
    height: 90vh;
    left: 2.5vw !important;
    top: 30px !important;
  }
  
  .config-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .table-cell {
    min-width: 60px;
    font-size: 9px;
  }
}